PageRenderTime 26ms CodeModel.GetById 19ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/packages/libgbafpc/examples/graphics/SimpleBGScroll/Makefile.fpc

https://github.com/slibre/freepascal
Unknown | 81 lines | 70 code | 11 blank | 0 comment | 0 complexity | 6e019500d991bbbdf2d8bd0178379391 MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
 1#
 2#   Makefile.fpc for Free Pascal libgbafpc 2.x.y Examples
 3#
 4
 5[target]
 6loaders=
 7programs=SimpleBGScroll
 8
 9[require]
10packages=libgbafpc
11tools=bin2s mmutil grit rmdir
12nortl=y
13
14[install]
15fpcpackage=y
16
17[default]
18cpu=arm
19target=gba
20fpcdir=../../../../..
21
22[clean]
23files=*.elf *.o *.s *.gba *.h *.bin *.map \
24       $(BUILD)/* \
25       $(INC)/*
26units=*
27
28[prerules]
29BUILD = build
30INC = inc
31AUDIO_FILES = $(foreach dir, $(notdir $(wildcard audio/*.*)), $(CURDIR)/audio/$(dir))
32GFX_FILES = $(foreach dir,gfx,$(notdir $(wildcard $(dir)/*.png)))
33BIN_FILES = $(foreach dir,data,$(notdir $(wildcard $(dir)/*)))
34
35[rules]
36.NOTPARALLEL:
37clean: dir_delete fpc_clean fpc_cleanall
38all: dir_make $(BIN_FILES) $(GFX_FILES) fpc_all
39
40#
41# Delete temp directories
42#
43dir_delete:
44        @$(DELTREE) $(CURDIR)/$(BUILD)
45        @$(DELTREE) $(CURDIR)/$(INC)
46
47#
48# Create temp directories
49#
50dir_make:
51ifneq ($(BUILD), $(CURDIR))
52        @$(MKDIR) $(BUILD)
53endif
54ifneq ($(INC), $(CURDIR))
55        @$(MKDIR) $(INC)
56endif
57
58#
59# Png files processing rule
60#
61$(GFX_FILES): $(wildcard %.png)
62        @echo 'Converting $(@) file to asm...'
63        $(GRIT) gfx/$(@) -fts -ff gfx/$(basename $(@)).grit -o$(BUILD)/$(@)
64        @echo 'Assembling $(@).s file...'
65        $(AS) -o $(BUILD)/$(basename $(@)).o $(BUILD)/$(basename $(@)).s
66        @echo 'Done!'
67
68#
69# Binary files processing rule
70#
71$(BIN_FILES): $(wildcard %.*)
72        @echo 'Converting $(@) file to asm...'
73        @$(BIN2S) data/$(@) > $(BUILD)/$(@).s
74        @echo 'Creating $(@).inc include file...'
75        @echo "var" > `(echo "inc/"$(@F) | tr . .)`.inc
76        @echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end: array [0..0] of cuint8; cvar; external;" >> `(echo "inc/"$(@F) | tr . .)`.inc
77        @echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`": array [0..0] of cuint8; cvar; external;" >> `(echo "inc/"$(@F) | tr . .)`.inc
78        @echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size": cuint32; cvar; external;" >> `(echo "inc/"$(@F) | tr . .)`.inc
79        @echo 'Assembling $(@).s file...'
80        @$(AS) -o $(BUILD)/$(@).o $(BUILD)/$(@).s
81        @echo 'Done!'