123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- #
- # Makefile.fpc for Free Pascal libndsfpc 2.x.y Examples
- #
- [target]
- loaders=
- programs=exceptionTest
- [require]
- packages=libndsfpc
- tools=bin2s mmutil grit_fpc rmdir mv fpcmake
- nortl=y
- [install]
- fpcpackage=y
- [compiler]
- options=-Xm
- targetdir=$(BIN)
- unittargetdir=$(BUILD)
- [default]
- cpu=arm
- target=nds
- fpcdir=../../../../..
- [clean]
- files=*.elf *.o *.s *.nds *.nef *.h *.bin *.map \
- $(BUILD)/* \
- $(INC)/* \
- $(BIN)/*
- units=*
- [prerules]
- BIN = bin
- BUILD = build
- DATA = data
- GFX = gfx
- INC = inc
- AUDIO_FILES = $(foreach dir, $(notdir $(wildcard audio/*.*)), $(CURDIR)/audio/$(dir))
- GFX_FILES = $(foreach dir, $(GFX), $(notdir $(wildcard $(dir)/*.bmp $(dir)/*.png)))
- BIN_FILES = $(foreach dir, $(DATA), $(notdir $(wildcard $(dir)/*)))
- [rules]
- .NOTPARALLEL:
- clean: dir_delete fpc_clean fpc_cleanall
- all: dir_make $(BIN_FILES) $(GFX_FILES) fpc_all
- #
- # Delete temp directories
- #
- dir_delete:
- @$(DELTREE) $(CURDIR)/$(BUILD)
- @$(DELTREE) $(CURDIR)/$(INC)
- @$(DELTREE) $(CURDIR)/$(BIN)
-
- #
- # Create temp directories
- #
- dir_make:
- ifneq ($(BUILD), $(CURDIR))
- @$(MKDIR) $(BUILD)
- endif
- ifneq ($(INC), $(CURDIR))
- @$(MKDIR) $(INC)
- endif
- ifneq ($(BIN), $(CURDIR))
- @$(MKDIR) $(BIN)
- endif
- #
- # Audio files processing rule
- #
- soundbank.bin.o : $(AUDIO_FILES)
- @$(MMUTIL) $^ -d -o$(BUILD)/soundbank.bin -h$(BUILD)/soundbank.h
- $(BIN2S) $(BUILD)/soundbank.bin > $(BUILD)/soundbank.bin.s
- $(AS) -o $(BUILD)/soundbank.bin.o $(BUILD)/soundbank.bin.s
- #
- # Png files processing rule
- #
- $(GFX_FILES): $(wildcard %.bmp %.png)
- @echo 'Converting $(@) file to asm...'
- $(GRIT_FPC) $(GFX)/$(@) -fp -fts -ff $(GFX)/$(basename $(@)).grit -o$(BUILD)/$(@)
- @echo 'Assembling $(@).s file...'
- $(AS) -o $(BUILD)/$(basename $(@)).o $(BUILD)/$(basename $(@)).s
- $(MV) -f $(BUILD)/$(basename $(@)).inc $(INC)/$(basename $(@)).inc
- @echo 'Done!'
- #
- # Binary files processing rule
- #
- $(BIN_FILES): $(wildcard %.*)
- @echo 'Converting $(@) file to asm...'
- @$(BIN2S) $(DATA)/$(@) > $(BUILD)/$(@).s
- @echo 'Creating $(@).inc include file...'
- @echo "var" > `(echo "$(INC)/"$(@F) | tr . .)`.inc
- @echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end: array [0..0] of cuint8; cvar; external;" >> `(echo "$(INC)/"$(@F) | tr . .)`.inc
- @echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`": array [0..0] of cuint8; cvar; external;" >> `(echo "$(INC)/"$(@F) | tr . .)`.inc
- @echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size": cuint32; cvar; external;" >> `(echo "$(INC)/"$(@F) | tr . .)`.inc
- @echo 'Assembling $(@).s file...'
- @$(AS) -o $(BUILD)/$(@).o $(BUILD)/$(@).s
- @echo 'Done!'
|