-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
54 lines (42 loc) · 1.21 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Project Name
BUILD_TARGET ?= pod
# Sources
CPP_SOURCES = grnltr.cpp windows.cpp
ifeq "$(BUILD_TARGET)" "bluemchen"
TARGET = grnltr_bluemchen
BLUEMCHEN_DIR = ./kxmx_bluemchen
CPP_SOURCES += $(BLUEMCHEN_DIR)/src/kxmx_bluemchen.cpp bluemchen.cpp
endif
ifeq "$(BUILD_TARGET)" "pod"
TARGET = grnltr_pod
CPP_SOURCES += pod.cpp
endif
# Library Locations
LIBDAISY_DIR = ../../libDaisy
DAISYSP_DIR = ../../DaisySP
# Includes FatFS source files within project.
USE_FATFS = 1
# Core location, and generic makefile.
SYSTEM_FILES_DIR = $(LIBDAISY_DIR)/core
include $(SYSTEM_FILES_DIR)/Makefile
# Optimize for size - slaps pod, you can fit so many grains into this thing
CFLAGS += -Os
# Do I have any double promotion bloating my code?
CFLAGS += -Wdouble-promotion
ifeq "$(BUILD_TARGET)" "bluemchen"
C_DEFS += -DTARGET_BLUEMCHEN
C_INCLUDES += -I$(BLUEMCHEN_DIR)/src
endif
ifeq "$(BUILD_TARGET)" "pod"
C_DEFS += -DTARGET_POD
endif
VERSION = $(shell git tag --sort=v:refname | tail -n1)
ifdef DEBUG_POD
C_DEFS += -DDEBUG_POD
VERSION := $(VERSION)-dbg
endif
C_DEFS += -DVER=\"$(VERSION)\"
release: build/$(TARGET).bin
mkdir -p rel
cp build/$(TARGET).bin rel/$(TARGET).$(VERSION).bin
cp build/$(TARGET).elf rel/$(TARGET).$(VERSION).elf