cscg22-gearboy

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

Makefile (1094B)


      1LCC	= ../../../bin/lcc
      2PNG2ASSET = ../../../bin/png2asset
      3
      4CFLAGS	=
      5
      6# Output name for compiled ROM
      7BINS	   = metasprites.gb
      8
      9# Add entries here to have them converted into metasprites
     10PNGSOURCES   = sprite.png
     11PNG_CSOURCES = $(PNGSOURCES:%.png=%.c)
     12PNG_CHEADERS = $(PNGSOURCES:%.png=%.h)
     13
     14# List of all C source files except those generated by png2asset
     15CSOURCES    = $(filter-out $(PNGSOURCES:%.png=%.c), $(wildcard *.c))
     16
     17all: $(BINS)
     18
     19compile.bat: Makefile
     20	@echo "REM Automatically generated from Makefile" > compile.bat
     21	@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
     22
     23# Use png2asset to convert the png into C formatted metasprite data
     24# -sh 48   : Sets sprite height to 48 (width remains automatic)
     25# -spr8x16 : Use 8x16 hardware sprites
     26# -c ...   : Set C output file
     27%.c:	%.png
     28	$(PNG2ASSET) $< -sh 48 -spr8x16 -c $@ 
     29
     30# Compile all C sources, including converted png metasprites
     31$(BINS): $(CSOURCES) $(PNG_CSOURCES)
     32	$(LCC) $(CFLAGS) -o $(BINS) $(CSOURCES) $(PNG_CSOURCES)
     33
     34
     35clean:
     36	rm -f *.o *.lst *.map *.gb *.ihx *.sym *.cdb *.adb *.asm $(PNG_CHEADERS) $(PNG_CSOURCES)