summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: a08751f6eb36fc6d18e5c8141b08fee62ef837a2 (plain) (blame)
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
LCC = ./gbdk/build/gbdk/bin/lcc
SDCC = ./sdcc/bin/sdcc
GEARBOY = ./gearboy/platforms/linux/gearboy

.PHONY: all clean run

all: main.gb 

clean:
	rm -f main.gb

$(SDCC):
	@if [ ! -e Makefile ]; then \
		cd sdcc && ./configure; \
	fi
	make -C sdcc

$(LCC): $(SDCC)
	SDCCDIR=$(PWD)/sdcc make -C gbdk

main.gb: main.c $(LCC)
	$(LCC) -o $@ -Wall $< -Wl-yp0x143=0x80

$(GEARBOY):
	DEBUG=1 make -C ./gearboy/platforms/linux

run: $(GEARBOY) main.gb
	$(GEARBOY) main.gb