cscg22-gearboy

CSCG 2022 Challenge 'Gearboy'
git clone https://git.sinitax.com/sinitax/cscg22-gearboy
Log | Files | Refs | sfeed.txt

Makefile (1272B)


      1CC	= ../../../bin/lcc -Wa-l -Wl-m -Wl-j
      2
      3BINS	= banks.gb \
      4
      5all:	$(BINS)
      6
      7compile.bat: Makefile
      8	@echo "REM Automatically generated from Makefile" > compile.bat
      9	@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
     10
     11%.o:	%.c
     12	$(CC) -c -o $@ $<
     13
     14%.s:	%.c
     15	$(CC) -S -o $@ $<
     16
     17%.o:	%.s
     18	$(CC) -c -o $@ $<
     19
     20%.gb:	%.o
     21	$(CC) -o $@ $<
     22
     23clean:
     24	rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi
     25
     26############################################################
     27# Multiple bank example
     28
     29# Compile bank 0 (no ROM)
     30#      RAM bank 0 : -Wf-ba0
     31#
     32bank_0.o:	bank_0.c
     33	$(CC) -Wf-ba0 -c -o $@ $<
     34
     35# Compile bank 1 (ROM+RAM)
     36#      ROM bank 1 : -Wf-bo1
     37#      RAM bank 1 : -Wf-ba1
     38#
     39bank_1.o:	bank_1.c
     40	$(CC) -Wf-bo1 -Wf-ba1 -c -o $@ $<
     41
     42# Compile bank 2 (ROM+RAM)
     43#      ROM bank 2 : -Wf-bo2
     44#      RAM bank 2 : -Wf-ba2
     45#
     46bank_2.o:	bank_2.c
     47	$(CC) -Wf-bo2 -Wf-ba2 -c -o $@ $<
     48
     49# Compile bank 3 (ROM+RAM)
     50#      ROM bank 3 : -Wf-bo3
     51#      RAM bank 3 : -Wf-ba3
     52#
     53bank_3.o:	bank_3.c
     54	$(CC) -Wf-bo3 -Wf-ba3 -c -o $@ $<
     55
     56# Link banks
     57#      MBC5+ROM+RAM : -Wl-yt0x19
     58#      4 ROM banks  : -Wl-yo4
     59#      4 RAM banks  : -Wl-ya4
     60#
     61banks.gb:	banks.o bank_0.o bank_1.o bank_2.o bank_3.o
     62	$(CC) -Wl-yt0x1A -Wl-yo4 -Wl-ya4 -o $@ banks.o bank_0.o bank_1.o bank_2.o bank_3.o
     63