-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (40 loc) · 1.61 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
#
# Simple Makefile that compiles all .c and .s files in the same folder
#
# If you move this project you can change the directory
# to match your GBDK root directory (ex: GBDK_HOME = "C:/GBDK/"
GBDK_HOME = C:/gbdk/
LCC = $(GBDK_HOME)bin/lcc
PNG2ASSET = $(GBDK_HOME)bin/png2asset
# You can uncomment the line below to turn on debug output
# LCC = $(LCC) -debug
# You can set the name of the .gb ROM file here
PROJECTNAME = TilmapCollision
GENDIR = gen
RESDIR = res
SRCDIR = src
DSTDIR = dist
BINS = $(PROJECTNAME).gb
BINS2 = $(PROJECTNAME)_SinglePoint.gb
CSOURCES := $(wildcard $(GENDIR)/*.c) src/common.c
all: clean prepare png2asset $(BINS) $(BINS2)
prepare:
mkdir -p $(GENDIR)
mkdir -p $(DSTDIR)
png2asset:
$(PNG2ASSET) $(RESDIR)/Tilemap.png -c $(GENDIR)/tilemap.c -map -source_tileset $(RESDIR)/Tileset.png -noflip -keep_palette_order
$(PNG2ASSET) $(RESDIR)/Tileset.png -c $(GENDIR)/tileset.c -tiles_only -map -noflip -keep_palette_order
$(PNG2ASSET) $(RESDIR)/Ball.png -c $(GENDIR)/ball.c -noflip -spr8x16 -keep_palette_order
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile and link all source files in a single call to LCC
$(BINS): src/main.c $(CSOURCES)
$(LCC) -I$(GENDIR) -o $(DSTDIR)/$@ src/main.c $(CSOURCES)
# Compile and link all source files in a single call to LCC
$(BINS2): src/main_singlepoint.c $(CSOURCES)
$(LCC) -I$(GENDIR) -o $(DSTDIR)/$@ src/main_singlepoint.c $(CSOURCES)
clean:
rm -f $(DSTDIR)/*.*
rm -f $(GENDIR)/*.*
rm -f *.o *.lst *.map *.gb *.ihx *.sym *.cdb *.adb *.asm