mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2026-01-16 13:01:38 +01:00
- Removed unused/outdated stuff from libndsfpc + Added new examples for libndsfpc + Added working (I hope so...) makefile.fpc for all libndsfpc/libgbafpc examples git-svn-id: trunk@13217 -
82 lines
2.1 KiB
Makefile
82 lines
2.1 KiB
Makefile
#
|
|
# Makefile.fpc for Free Pascal libgbafpc 2.x.y Examples
|
|
#
|
|
|
|
[target]
|
|
loaders=
|
|
programs=PcxView
|
|
|
|
[require]
|
|
packages=libgbafpc
|
|
tools=bin2s mmutil grit rmdir
|
|
nortl=y
|
|
|
|
[install]
|
|
fpcpackage=y
|
|
|
|
[default]
|
|
cpu=arm
|
|
target=gba
|
|
fpcdir=../../../../..
|
|
|
|
[clean]
|
|
files=*.elf *.o *.s *.gba *.h *.bin *.map \
|
|
$(BUILD)/* \
|
|
$(INC)/*
|
|
units=*
|
|
|
|
[prerules]
|
|
BUILD = build
|
|
INC = inc
|
|
AUDIO_FILES = $(foreach dir, $(notdir $(wildcard audio/*.*)), $(CURDIR)/audio/$(dir))
|
|
GFX_FILES = $(foreach dir,gfx,$(notdir $(wildcard $(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)
|
|
|
|
#
|
|
# Create temp directories
|
|
#
|
|
dir_make:
|
|
ifneq ($(BUILD), $(CURDIR))
|
|
@$(MKDIR) $(BUILD)
|
|
endif
|
|
ifneq ($(INC), $(CURDIR))
|
|
@$(MKDIR) $(INC)
|
|
endif
|
|
|
|
#
|
|
# Png files processing rule
|
|
#
|
|
$(GFX_FILES): $(wildcard %.png)
|
|
@echo 'Converting $(@) file to asm...'
|
|
$(GRIT) gfx/$(@) -fts -ff gfx/$(basename $(@)).grit -o$(BUILD)/$(@)
|
|
@echo 'Assembling $(@).s file...'
|
|
$(AS) -o $(BUILD)/$(basename $(@)).o $(BUILD)/$(basename $(@)).s
|
|
@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!'
|