forked from UrbanZero/bunkerboy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (31 loc) · 1.08 KB
/
Makefile
File metadata and controls
42 lines (31 loc) · 1.08 KB
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
#
# Simple GBDK-2020 Makefile: compiles all .c and .s from src/, assets/, and project root
#
# Point this to your GBDK root (defaults to 3 levels up)
ifndef GBDK_HOME
GBDK_HOME := ../../../
endif
LCC := "$(GBDK_HOME)bin/lcc"
# Output ROM name (Example.gb)
PROJECT := BunkerBoy_jam
BINS := $(PROJECT).gb
# Where to look for sources
SRC_DIRS := src assets .
C_SOURCES := $(foreach d,$(SRC_DIRS),$(wildcard $(d)/*.c))
ASM_SOURCES := $(foreach d,$(SRC_DIRS),$(wildcard $(d)/*.s))
# Tell the compiler where headers live
INCLUDES := -I"$(GBDK_HOME)include" -Iinclude -Iassets -IhUGEDriver/include
# Link the prebuilt driver library by adding it as an input
HUGE_LIB := hUGEDriver/gbdk/hUGEDriver.lib
# Optional: target & linker flags (DMG)
LCCFLAGS ?= -msm83:gb -Wm-yo4 -Wm-yt0x19 -Wm-ys
# Debugging (enable with: make GBDK_DEBUG=1)
ifdef GBDK_DEBUG
LCCFLAGS += -debug -v
endif
all: $(BINS)
# Single-call compile & link
$(BINS): $(C_SOURCES) $(ASM_SOURCES)
$(LCC) $(LCCFLAGS) $(INCLUDES) -o $@ $^ $(HUGE_LIB)
clean:
- rm -f *.o *.lst *.map *.gb *.ihx *.sym *.cdb *.adb *.asm *.noi *.rst