PageRenderTime 15ms CodeModel.GetById 10ms app.highlight 3ms RepoModel.GetById 0ms app.codeStats 0ms

/packages/libogcfpc/examples/graphics/gx/neheGX/lesson6/Makefile.fpc

https://github.com/slibre/freepascal
Unknown | 87 lines | 74 code | 13 blank | 0 comment | 0 complexity | fa36b2f0f93909ad26931d588d2bd70b MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
 1#
 2#   Makefile.fpc for Free Pascal libogcfpc 2.x.y Examples
 3#
 4
 5[target]
 6loaders= 
 7programs=lesson6
 8
 9[require]
10packages=libogcfpc
11tools=bin2s rmdir gxtexconv
12nortl=y
13
14[install]
15fpcpackage=y
16
17[default]
18cpu=powerpc
19target=wii
20fpcdir=../../../../../../..
21
22[compiler]
23options=-g -Xm  
24
25[clean]
26files=*.elf *.o *.s *.h *.bin *.map \
27       $(BUILD)/* \
28       $(INC)/*
29units=*
30
31[prerules]
32BUILD = build
33INC = inc
34DATA = data
35TEXTURES = textures
36SCF_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf)))
37TPL_FILES = $(basename $(SCF_FILES)).tpl 
38
39[rules]
40.NOTPARALLEL:
41.PHONY: clean all
42clean: dir_delete fpc_clean fpc_cleanall    
43all: dir_make $(TPL_FILES) fpc_all 
44
45#
46# Delete temp directories
47#
48dir_delete:
49        @$(DELTREE) $(CURDIR)/$(BUILD) 
50        @$(DELTREE) $(CURDIR)/$(DATA) 
51        @$(DELTREE) $(CURDIR)/$(INC) 
52        
53#
54# Create temp directories
55#
56dir_make:
57ifneq ($(BUILD), $(CURDIR))
58        @$(MKDIR) $(BUILD)
59endif
60ifneq ($(INC), $(CURDIR))
61        @$(MKDIR) $(INC)
62endif
63ifneq ($(DATA), $(CURDIR))
64        @$(MKDIR) $(DATA)
65endif
66
67#
68# Textures processing rule
69#
70$(TPL_FILES):
71        @echo 'Creating tpl file...'
72        $(GXTEXCONV) -s textures/$(SCF_FILES) -o $(DATA)/$(TPL_FILES)
73        @echo $(DATA)/$(TPL_FILES)
74        @$(bin2o)  	
75
76
77#
78# Binary files processing rule
79# 
80define bin2o
81        @$(BIN2S) -a 32 $(DATA)/$(@) > $(BUILD)/$(@).s
82        @$(AS) -o $(BUILD)/$(@).o $(BUILD)/$(@).s
83        @echo "var" > `(echo $(INC)"/"$(@F) | tr . .)`.inc
84        @echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end: array [0..0] of cuint8; cvar; external;" >> `(echo $(INC)"/"$(@F) | tr . .)`.inc
85        @echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`": array [0..0] of cuint8; cvar; external;" >> `(echo $(INC)"/"$(@F) | tr . .)`.inc
86        @echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size": cuint32; cvar; external;" >> `(echo $(INC)"/"$(@F) | tr . .)`.inc
87endef