diff options
Diffstat (limited to 'packages/libogcfpc/examples/graphics')
21 files changed, 191 insertions, 181 deletions
diff --git a/packages/libogcfpc/examples/graphics/gx/gxSprites/Makefile b/packages/libogcfpc/examples/graphics/gx/gxSprites/Makefile index 4dbac1a020..fe85b79baf 100644 --- a/packages/libogcfpc/examples/graphics/gx/gxSprites/Makefile +++ b/packages/libogcfpc/examples/graphics/gx/gxSprites/Makefile @@ -270,8 +270,8 @@ BUILD = build INC = inc DATA = data TEXTURES = textures -TPL_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf))) -BIN_FILES = $(foreach dir,data,$(notdir $(wildcard $(dir)/*))) +SCF_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf))) +TPL_FILES = $(basename $(SCF_FILES)).tpl ifeq ($(FULL_TARGET),powerpc-wii) override TARGET_PROGRAMS+=gxsprites endif @@ -1643,10 +1643,12 @@ ifneq ($(wildcard fpcmake.loc),) include fpcmake.loc endif .NOTPARALLEL: -clean: dir_delete fpc_clean fpc_cleanall -all: dir_make $(TPL_FILES) $(BIN_FILES) fpc_all +.PHONY: clean all +clean: dir_delete fpc_clean fpc_cleanall +all: dir_make $(TPL_FILES) fpc_all dir_delete: @$(DELTREE) $(CURDIR)/$(BUILD) + @$(DELTREE) $(CURDIR)/$(DATA) @$(DELTREE) $(CURDIR)/$(INC) dir_make: ifneq ($(BUILD), $(CURDIR)) @@ -1658,17 +1660,16 @@ endif ifneq ($(DATA), $(CURDIR)) @$(MKDIR) $(DATA) endif -$(TPL_FILES): $(wildcard %.scf) +$(TPL_FILES): @echo 'Creating tpl file...' - $(GXTEXCONV) -s textures/$(@) -o $(DATA)/$(basename $(@)).tpl -$(BIN_FILES): $(wildcard %.*) - @echo 'Converting $(@) file to asm...' - @$(BIN2S) -a 32 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...' + $(GXTEXCONV) -s textures/$(SCF_FILES) -o $(DATA)/$(TPL_FILES) + @echo $(DATA)/$(TPL_FILES) + @$(bin2o) +define bin2o + @$(BIN2S) -a 32 $(DATA)/$(@) > $(BUILD)/$(@).s @$(AS) -o $(BUILD)/$(@).o $(BUILD)/$(@).s - @echo 'Done!' + @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 +endef diff --git a/packages/libogcfpc/examples/graphics/gx/gxSprites/Makefile.fpc b/packages/libogcfpc/examples/graphics/gx/gxSprites/Makefile.fpc index 49e1be6c9c..011ae4086f 100644 --- a/packages/libogcfpc/examples/graphics/gx/gxSprites/Makefile.fpc +++ b/packages/libogcfpc/examples/graphics/gx/gxSprites/Makefile.fpc @@ -3,7 +3,7 @@ # [target] -loaders= +loaders= programs=gxsprites [require] @@ -33,19 +33,21 @@ BUILD = build INC = inc DATA = data TEXTURES = textures -TPL_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf))) -BIN_FILES = $(foreach dir,data,$(notdir $(wildcard $(dir)/*))) +SCF_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf))) +TPL_FILES = $(basename $(SCF_FILES)).tpl [rules] .NOTPARALLEL: -clean: dir_delete fpc_clean fpc_cleanall -all: dir_make $(TPL_FILES) $(BIN_FILES) fpc_all +.PHONY: clean all +clean: dir_delete fpc_clean fpc_cleanall +all: dir_make $(TPL_FILES) fpc_all # # Delete temp directories # dir_delete: @$(DELTREE) $(CURDIR)/$(BUILD) + @$(DELTREE) $(CURDIR)/$(DATA) @$(DELTREE) $(CURDIR)/$(INC) # @@ -65,22 +67,21 @@ endif # # Textures processing rule # -$(TPL_FILES): $(wildcard %.scf) +$(TPL_FILES): @echo 'Creating tpl file...' - $(GXTEXCONV) -s textures/$(@) -o $(DATA)/$(basename $(@)).tpl + $(GXTEXCONV) -s textures/$(SCF_FILES) -o $(DATA)/$(TPL_FILES) + @echo $(DATA)/$(TPL_FILES) + @$(bin2o) + - # # Binary files processing rule # -$(BIN_FILES): $(wildcard %.*) - @echo 'Converting $(@) file to asm...' - @$(BIN2S) -a 32 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...' +define bin2o + @$(BIN2S) -a 32 $(DATA)/$(@) > $(BUILD)/$(@).s @$(AS) -o $(BUILD)/$(@).o $(BUILD)/$(@).s - @echo 'Done!' + @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 +endef
\ No newline at end of file diff --git a/packages/libogcfpc/examples/graphics/gx/gxSprites/gxsprites.pp b/packages/libogcfpc/examples/graphics/gx/gxSprites/gxsprites.pp index 64c35c9095..013a3ae6d0 100644 --- a/packages/libogcfpc/examples/graphics/gx/gxSprites/gxsprites.pp +++ b/packages/libogcfpc/examples/graphics/gx/gxSprites/gxsprites.pp @@ -5,7 +5,7 @@ program gxsprites; {$mode objfpc} uses - cmem, ctypes, gccore; + cmem, ctypes, gctypes, gccore; {$include inc/textures.tpl.inc} {$link build/textures.tpl.o} diff --git a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson1/lesson1.pp b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson1/lesson1.pp index f18cb4df9b..1169a3b22d 100644 --- a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson1/lesson1.pp +++ b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson1/lesson1.pp @@ -4,7 +4,7 @@ program lesson1; {$mode objfpc} uses - cmem, ctypes, gccore; + cmem, ctypes, gctypes, gccore; const DEFAULT_FIFO_SIZE = (256*1024); diff --git a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson2/lesson2.pp b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson2/lesson2.pp index fcc7bd712e..b171f550ff 100644 --- a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson2/lesson2.pp +++ b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson2/lesson2.pp @@ -4,7 +4,7 @@ program lesson2; {$mode objfpc} uses - cmem, ctypes, gccore; + cmem, ctypes, gctypes, gccore; const DEFAULT_FIFO_SIZE = (256*1024); diff --git a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson3/lesson3.pp b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson3/lesson3.pp index ece9cfa5c1..a369133316 100644 --- a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson3/lesson3.pp +++ b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson3/lesson3.pp @@ -4,7 +4,7 @@ program lesson3; {$mode objfpc} uses - cmem, ctypes, gccore; + cmem, ctypes, gctypes, gccore; const DEFAULT_FIFO_SIZE = (256*1024); diff --git a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson4/lesson4.pp b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson4/lesson4.pp index f3094bdc84..b66a00f197 100644 --- a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson4/lesson4.pp +++ b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson4/lesson4.pp @@ -5,7 +5,7 @@ program lesson4; {$mode objfpc} uses - cmem, ctypes, gccore; + cmem, ctypes, gctypes, gccore; const DEFAULT_FIFO_SIZE = (256 * 1024); diff --git a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson5/lesson5.pp b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson5/lesson5.pp index 5c1264becd..0affebedce 100644 --- a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson5/lesson5.pp +++ b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson5/lesson5.pp @@ -5,7 +5,7 @@ program lesson5; {$mode objfpc} uses - cmem, ctypes, gccore; + cmem, ctypes, gctypes, gccore; const DEFAULT_FIFO_SIZE = (256 * 1024); diff --git a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson6/Makefile b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson6/Makefile index 2109732b40..a76476280b 100644 --- a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson6/Makefile +++ b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson6/Makefile @@ -270,8 +270,8 @@ BUILD = build INC = inc DATA = data TEXTURES = textures -TPL_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf))) -BIN_FILES = $(foreach dir,data,$(notdir $(wildcard $(dir)/*))) +SCF_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf))) +TPL_FILES = $(basename $(SCF_FILES)).tpl ifeq ($(FULL_TARGET),powerpc-wii) override TARGET_PROGRAMS+=lesson6 endif @@ -1643,10 +1643,12 @@ ifneq ($(wildcard fpcmake.loc),) include fpcmake.loc endif .NOTPARALLEL: -clean: dir_delete fpc_clean fpc_cleanall -all: dir_make $(TPL_FILES) $(BIN_FILES) fpc_all +.PHONY: clean all +clean: dir_delete fpc_clean fpc_cleanall +all: dir_make $(TPL_FILES) fpc_all dir_delete: @$(DELTREE) $(CURDIR)/$(BUILD) + @$(DELTREE) $(CURDIR)/$(DATA) @$(DELTREE) $(CURDIR)/$(INC) dir_make: ifneq ($(BUILD), $(CURDIR)) @@ -1658,17 +1660,16 @@ endif ifneq ($(DATA), $(CURDIR)) @$(MKDIR) $(DATA) endif -$(TPL_FILES): $(wildcard %.scf) +$(TPL_FILES): @echo 'Creating tpl file...' - $(GXTEXCONV) -s textures/$(@) -o $(DATA)/$(basename $(@)).tpl -$(BIN_FILES): $(wildcard %.*) - @echo 'Converting $(@) file to asm...' - @$(BIN2S) -a 32 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...' + $(GXTEXCONV) -s textures/$(SCF_FILES) -o $(DATA)/$(TPL_FILES) + @echo $(DATA)/$(TPL_FILES) + @$(bin2o) +define bin2o + @$(BIN2S) -a 32 $(DATA)/$(@) > $(BUILD)/$(@).s @$(AS) -o $(BUILD)/$(@).o $(BUILD)/$(@).s - @echo 'Done!' + @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 +endef diff --git a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson6/Makefile.fpc b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson6/Makefile.fpc index 69cd9ed05c..8ccdc2fdee 100644 --- a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson6/Makefile.fpc +++ b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson6/Makefile.fpc @@ -33,19 +33,21 @@ BUILD = build INC = inc DATA = data TEXTURES = textures -TPL_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf))) -BIN_FILES = $(foreach dir,data,$(notdir $(wildcard $(dir)/*))) +SCF_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf))) +TPL_FILES = $(basename $(SCF_FILES)).tpl [rules] .NOTPARALLEL: -clean: dir_delete fpc_clean fpc_cleanall -all: dir_make $(TPL_FILES) $(BIN_FILES) fpc_all +.PHONY: clean all +clean: dir_delete fpc_clean fpc_cleanall +all: dir_make $(TPL_FILES) fpc_all # # Delete temp directories # dir_delete: @$(DELTREE) $(CURDIR)/$(BUILD) + @$(DELTREE) $(CURDIR)/$(DATA) @$(DELTREE) $(CURDIR)/$(INC) # @@ -65,22 +67,21 @@ endif # # Textures processing rule # -$(TPL_FILES): $(wildcard %.scf) +$(TPL_FILES): @echo 'Creating tpl file...' - $(GXTEXCONV) -s textures/$(@) -o $(DATA)/$(basename $(@)).tpl + $(GXTEXCONV) -s textures/$(SCF_FILES) -o $(DATA)/$(TPL_FILES) + @echo $(DATA)/$(TPL_FILES) + @$(bin2o) + - # # Binary files processing rule # -$(BIN_FILES): $(wildcard %.*) - @echo 'Converting $(@) file to asm...' - @$(BIN2S) -a 32 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...' +define bin2o + @$(BIN2S) -a 32 $(DATA)/$(@) > $(BUILD)/$(@).s @$(AS) -o $(BUILD)/$(@).o $(BUILD)/$(@).s - @echo 'Done!' + @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 +endef
\ No newline at end of file diff --git a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson6/lesson6.pp b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson6/lesson6.pp index d173dd6523..6bbb38c43d 100644 --- a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson6/lesson6.pp +++ b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson6/lesson6.pp @@ -5,7 +5,7 @@ program lesson6; {$mode objfpc} uses - cmem, ctypes, gccore; + cmem, ctypes, gctypes, gccore; {$include inc/NeHe.tpl.inc} {$link build/NeHe.tpl.o} diff --git a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson7/Makefile b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson7/Makefile index 4a96e70452..97a1d91878 100644 --- a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson7/Makefile +++ b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson7/Makefile @@ -270,8 +270,8 @@ BUILD = build INC = inc DATA = data TEXTURES = textures -TPL_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf))) -BIN_FILES = $(foreach dir,data,$(notdir $(wildcard $(dir)/*))) +SCF_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf))) +TPL_FILES = $(basename $(SCF_FILES)).tpl ifeq ($(FULL_TARGET),powerpc-wii) override TARGET_PROGRAMS+=lesson7 endif @@ -1643,10 +1643,12 @@ ifneq ($(wildcard fpcmake.loc),) include fpcmake.loc endif .NOTPARALLEL: -clean: dir_delete fpc_clean fpc_cleanall -all: dir_make $(TPL_FILES) $(BIN_FILES) fpc_all +.PHONY: clean all +clean: dir_delete fpc_clean fpc_cleanall +all: dir_make $(TPL_FILES) fpc_all dir_delete: @$(DELTREE) $(CURDIR)/$(BUILD) + @$(DELTREE) $(CURDIR)/$(DATA) @$(DELTREE) $(CURDIR)/$(INC) dir_make: ifneq ($(BUILD), $(CURDIR)) @@ -1658,17 +1660,16 @@ endif ifneq ($(DATA), $(CURDIR)) @$(MKDIR) $(DATA) endif -$(TPL_FILES): $(wildcard %.scf) +$(TPL_FILES): @echo 'Creating tpl file...' - $(GXTEXCONV) -s textures/$(@) -o $(DATA)/$(basename $(@)).tpl -$(BIN_FILES): $(wildcard %.*) - @echo 'Converting $(@) file to asm...' - @$(BIN2S) -a 32 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...' + $(GXTEXCONV) -s textures/$(SCF_FILES) -o $(DATA)/$(TPL_FILES) + @echo $(DATA)/$(TPL_FILES) + @$(bin2o) +define bin2o + @$(BIN2S) -a 32 $(DATA)/$(@) > $(BUILD)/$(@).s @$(AS) -o $(BUILD)/$(@).o $(BUILD)/$(@).s - @echo 'Done!' + @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 +endef diff --git a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson7/Makefile.fpc b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson7/Makefile.fpc index bd84d8ff82..020677d8dc 100644 --- a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson7/Makefile.fpc +++ b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson7/Makefile.fpc @@ -33,19 +33,21 @@ BUILD = build INC = inc DATA = data TEXTURES = textures -TPL_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf))) -BIN_FILES = $(foreach dir,data,$(notdir $(wildcard $(dir)/*))) +SCF_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf))) +TPL_FILES = $(basename $(SCF_FILES)).tpl [rules] .NOTPARALLEL: -clean: dir_delete fpc_clean fpc_cleanall -all: dir_make $(TPL_FILES) $(BIN_FILES) fpc_all +.PHONY: clean all +clean: dir_delete fpc_clean fpc_cleanall +all: dir_make $(TPL_FILES) fpc_all # # Delete temp directories # dir_delete: @$(DELTREE) $(CURDIR)/$(BUILD) + @$(DELTREE) $(CURDIR)/$(DATA) @$(DELTREE) $(CURDIR)/$(INC) # @@ -65,22 +67,21 @@ endif # # Textures processing rule # -$(TPL_FILES): $(wildcard %.scf) +$(TPL_FILES): @echo 'Creating tpl file...' - $(GXTEXCONV) -s textures/$(@) -o $(DATA)/$(basename $(@)).tpl + $(GXTEXCONV) -s textures/$(SCF_FILES) -o $(DATA)/$(TPL_FILES) + @echo $(DATA)/$(TPL_FILES) + @$(bin2o) + - # # Binary files processing rule # -$(BIN_FILES): $(wildcard %.*) - @echo 'Converting $(@) file to asm...' - @$(BIN2S) -a 32 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...' +define bin2o + @$(BIN2S) -a 32 $(DATA)/$(@) > $(BUILD)/$(@).s @$(AS) -o $(BUILD)/$(@).o $(BUILD)/$(@).s - @echo 'Done!' + @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 +endef
\ No newline at end of file diff --git a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson7/lesson7.pp b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson7/lesson7.pp index 91a467637b..c242d98a39 100644 --- a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson7/lesson7.pp +++ b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson7/lesson7.pp @@ -5,7 +5,7 @@ program lesson7; {$mode objfpc} uses - cmem, ctypes, gccore; + cmem, ctypes, gctypes, gccore; {$include inc/crate.tpl.inc} {$link build/crate.tpl.o} diff --git a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson8/Makefile b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson8/Makefile index 29e5c3138d..db45651d12 100644 --- a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson8/Makefile +++ b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson8/Makefile @@ -270,8 +270,8 @@ BUILD = build INC = inc DATA = data TEXTURES = textures -TPL_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf))) -BIN_FILES = $(foreach dir,data,$(notdir $(wildcard $(dir)/*))) +SCF_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf))) +TPL_FILES = $(basename $(SCF_FILES)).tpl ifeq ($(FULL_TARGET),powerpc-wii) override TARGET_PROGRAMS+=lesson8 endif @@ -1643,10 +1643,12 @@ ifneq ($(wildcard fpcmake.loc),) include fpcmake.loc endif .NOTPARALLEL: -clean: dir_delete fpc_clean fpc_cleanall -all: dir_make $(TPL_FILES) $(BIN_FILES) fpc_all +.PHONY: clean all +clean: dir_delete fpc_clean fpc_cleanall +all: dir_make $(TPL_FILES) fpc_all dir_delete: @$(DELTREE) $(CURDIR)/$(BUILD) + @$(DELTREE) $(CURDIR)/$(DATA) @$(DELTREE) $(CURDIR)/$(INC) dir_make: ifneq ($(BUILD), $(CURDIR)) @@ -1658,17 +1660,16 @@ endif ifneq ($(DATA), $(CURDIR)) @$(MKDIR) $(DATA) endif -$(TPL_FILES): $(wildcard %.scf) +$(TPL_FILES): @echo 'Creating tpl file...' - $(GXTEXCONV) -s textures/$(@) -o $(DATA)/$(basename $(@)).tpl -$(BIN_FILES): $(wildcard %.*) - @echo 'Converting $(@) file to asm...' - @$(BIN2S) -a 32 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...' + $(GXTEXCONV) -s textures/$(SCF_FILES) -o $(DATA)/$(TPL_FILES) + @echo $(DATA)/$(TPL_FILES) + @$(bin2o) +define bin2o + @$(BIN2S) -a 32 $(DATA)/$(@) > $(BUILD)/$(@).s @$(AS) -o $(BUILD)/$(@).o $(BUILD)/$(@).s - @echo 'Done!' + @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 +endef diff --git a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson8/Makefile.fpc b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson8/Makefile.fpc index db4dd3d865..d79da2de96 100644 --- a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson8/Makefile.fpc +++ b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson8/Makefile.fpc @@ -33,19 +33,21 @@ BUILD = build INC = inc DATA = data TEXTURES = textures -TPL_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf))) -BIN_FILES = $(foreach dir,data,$(notdir $(wildcard $(dir)/*))) +SCF_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf))) +TPL_FILES = $(basename $(SCF_FILES)).tpl [rules] .NOTPARALLEL: -clean: dir_delete fpc_clean fpc_cleanall -all: dir_make $(TPL_FILES) $(BIN_FILES) fpc_all +.PHONY: clean all +clean: dir_delete fpc_clean fpc_cleanall +all: dir_make $(TPL_FILES) fpc_all # # Delete temp directories # dir_delete: @$(DELTREE) $(CURDIR)/$(BUILD) + @$(DELTREE) $(CURDIR)/$(DATA) @$(DELTREE) $(CURDIR)/$(INC) # @@ -65,22 +67,21 @@ endif # # Textures processing rule # -$(TPL_FILES): $(wildcard %.scf) +$(TPL_FILES): @echo 'Creating tpl file...' - $(GXTEXCONV) -s textures/$(@) -o $(DATA)/$(basename $(@)).tpl + $(GXTEXCONV) -s textures/$(SCF_FILES) -o $(DATA)/$(TPL_FILES) + @echo $(DATA)/$(TPL_FILES) + @$(bin2o) + - # # Binary files processing rule # -$(BIN_FILES): $(wildcard %.*) - @echo 'Converting $(@) file to asm...' - @$(BIN2S) -a 32 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...' +define bin2o + @$(BIN2S) -a 32 $(DATA)/$(@) > $(BUILD)/$(@).s @$(AS) -o $(BUILD)/$(@).o $(BUILD)/$(@).s - @echo 'Done!' + @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 +endef
\ No newline at end of file diff --git a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson8/lesson8.pp b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson8/lesson8.pp index b593823b2e..54092eb946 100644 --- a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson8/lesson8.pp +++ b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson8/lesson8.pp @@ -5,7 +5,7 @@ program lesson8; {$mode objfpc} uses - cmem, ctypes, gccore, math; + cmem, ctypes, gctypes, gccore, math; {$include inc/glass.tpl.inc} {$link build/glass.tpl.o} diff --git a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson9/Makefile b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson9/Makefile index a0a16c774c..3b3dcdb190 100644 --- a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson9/Makefile +++ b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson9/Makefile @@ -270,8 +270,8 @@ BUILD = build INC = inc DATA = data TEXTURES = textures -TPL_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf))) -BIN_FILES = $(foreach dir,data,$(notdir $(wildcard $(dir)/*))) +SCF_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf))) +TPL_FILES = $(basename $(SCF_FILES)).tpl ifeq ($(FULL_TARGET),powerpc-wii) override TARGET_PROGRAMS+=lesson9 endif @@ -1643,10 +1643,12 @@ ifneq ($(wildcard fpcmake.loc),) include fpcmake.loc endif .NOTPARALLEL: -clean: dir_delete fpc_clean fpc_cleanall -all: dir_make $(TPL_FILES) $(BIN_FILES) fpc_all +.PHONY: clean all +clean: dir_delete fpc_clean fpc_cleanall +all: dir_make $(TPL_FILES) fpc_all dir_delete: @$(DELTREE) $(CURDIR)/$(BUILD) + @$(DELTREE) $(CURDIR)/$(DATA) @$(DELTREE) $(CURDIR)/$(INC) dir_make: ifneq ($(BUILD), $(CURDIR)) @@ -1658,17 +1660,16 @@ endif ifneq ($(DATA), $(CURDIR)) @$(MKDIR) $(DATA) endif -$(TPL_FILES): $(wildcard %.scf) - @echo 'Creating tpl file...' - $(GXTEXCONV) -s textures/$(@) -o $(DATA)/$(basename $(@)).tpl -$(BIN_FILES): $(wildcard %.*) - @echo 'Converting $(@) file to asm...' - @$(BIN2S) -a 32 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!' +$(TPL_FILES): + @echo 'Creating tpl file...' + $(GXTEXCONV) -s textures/$(SCF_FILES) -o $(DATA)/$(TPL_FILES) + @echo $(DATA)/$(TPL_FILES) + @$(bin2o) +define bin2o + @$(BIN2S) -a 32 $(DATA)/$(@) > $(BUILD)/$(@).s + @$(AS) -o $(BUILD)/$(@).o $(BUILD)/$(@).s + @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 +endef diff --git a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson9/Makefile.fpc b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson9/Makefile.fpc index 01a9f2992b..99d0c55c90 100644 --- a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson9/Makefile.fpc +++ b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson9/Makefile.fpc @@ -33,19 +33,21 @@ BUILD = build INC = inc DATA = data TEXTURES = textures -TPL_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf))) -BIN_FILES = $(foreach dir,data,$(notdir $(wildcard $(dir)/*))) +SCF_FILES = $(foreach dir,textures,$(notdir $(wildcard $(dir)/*.scf))) +TPL_FILES = $(basename $(SCF_FILES)).tpl [rules] .NOTPARALLEL: -clean: dir_delete fpc_clean fpc_cleanall -all: dir_make $(TPL_FILES) $(BIN_FILES) fpc_all +.PHONY: clean all +clean: dir_delete fpc_clean fpc_cleanall +all: dir_make $(TPL_FILES) fpc_all # # Delete temp directories # dir_delete: @$(DELTREE) $(CURDIR)/$(BUILD) + @$(DELTREE) $(CURDIR)/$(DATA) @$(DELTREE) $(CURDIR)/$(INC) # @@ -65,22 +67,21 @@ endif # # Textures processing rule # -$(TPL_FILES): $(wildcard %.scf) - @echo 'Creating tpl file...' - $(GXTEXCONV) -s textures/$(@) -o $(DATA)/$(basename $(@)).tpl +$(TPL_FILES): + @echo 'Creating tpl file...' + $(GXTEXCONV) -s textures/$(SCF_FILES) -o $(DATA)/$(TPL_FILES) + @echo $(DATA)/$(TPL_FILES) + @$(bin2o) + - # # Binary files processing rule # -$(BIN_FILES): $(wildcard %.*) - @echo 'Converting $(@) file to asm...' - @$(BIN2S) -a 32 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!' +define bin2o + @$(BIN2S) -a 32 $(DATA)/$(@) > $(BUILD)/$(@).s + @$(AS) -o $(BUILD)/$(@).o $(BUILD)/$(@).s + @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 +endef
\ No newline at end of file diff --git a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson9/lesson9.pp b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson9/lesson9.pp index 4f2dd62ab6..eb81a15e14 100644 --- a/packages/libogcfpc/examples/graphics/gx/neheGX/lesson9/lesson9.pp +++ b/packages/libogcfpc/examples/graphics/gx/neheGX/lesson9/lesson9.pp @@ -5,7 +5,7 @@ program lesson9; {$mode objfpc} uses - cmem, ctypes, gccore; + cmem, ctypes, gctypes, gccore; {$include inc/startex.tpl.inc} {$link build/startex.tpl.o} diff --git a/packages/libogcfpc/examples/graphics/gx/triangle/triangle.pp b/packages/libogcfpc/examples/graphics/gx/triangle/triangle.pp index e833a1874e..8c7b004930 100644 --- a/packages/libogcfpc/examples/graphics/gx/triangle/triangle.pp +++ b/packages/libogcfpc/examples/graphics/gx/triangle/triangle.pp @@ -6,7 +6,7 @@ program triangle; {$inline on} uses - cmem, ctypes, gccore; + cmem, ctypes, gctypes, gccore; var framebuffer: pcuint32; |