-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
25 lines (20 loc) · 945 Bytes
/
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
GBDK_HOME = /home/et/dev/gbdk/
CC = $(GBDK_HOME)bin/lcc
COMPILER_FLAGS = -std=c99 -Wall -g
SRCS = $(wildcard ./src/*.c ./lib/*.c)
OBJS = $(SRCS:.c=.o)
INCLUDE_PATHS = -Iinclude
# Change this to what you would like to call your ROM
TARGET = bunny.gb
all: $(TARGET)
# Make a .GB ROM in ./build (create it if it does not exist), and remove all of the intermediate files
$(TARGET): $(OBJS)
mkdir build 2>/dev/null; $(CC) -o ./build/$@ $(OBJS)
rm -f ./src/*.o ./src/*.lst ./src/*.sym ./src/*.asm ./build/*.ihx
rm -f ./lib/*.o ./lib/*.lst ./lib/*.sym ./lib/*.asm
%.o: %.c
$(CC) $(COMPILER_FLAGS) $(INCLUDE_PATHS) -c $< -o $@
# Delete all of the generated files including the ROM
clean:
rm -f ./src/*.o ./src/*.lst ./src*.map ./src/*~ ./src/*.rel ./src/*.cdb ./src/*.lnk ./src/*.sym ./src/*.asm ./src/*.noi ./build/*.ihx
rm -f ./lib/*.o ./lib/*.lst ./lib*.map ./lib/*~ ./lib/*.rel ./lib/*.cdb ./lib/*.lnk ./lib/*.sym ./lib/*.asm ./lib/*.noi