diff options
Diffstat (limited to 'packages/libogcfpc/examples')
31 files changed, 451 insertions, 993 deletions
diff --git a/packages/libogcfpc/examples/devices/Makefile b/packages/libogcfpc/examples/devices/Makefile index 3fbde4960e..a5def5a6d0 100644 --- a/packages/libogcfpc/examples/devices/Makefile +++ b/packages/libogcfpc/examples/devices/Makefile @@ -265,7 +265,7 @@ UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET)) endif PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra) ifeq ($(FULL_TARGET),powerpc-wii) -override TARGET_DIRS+=network usbgecko usbkeyboard +override TARGET_DIRS+=network usbkeyboard usbgecko endif override INSTALL_FPCPACKAGE=y ifdef REQUIRE_UNITSDIR @@ -1417,8 +1417,8 @@ fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2 fpc_makefiles: fpc_makefile fpc_makefile_dirs ifeq ($(FULL_TARGET),powerpc-wii) TARGET_DIRS_NETWORK=1 -TARGET_DIRS_USBGECKO=1 TARGET_DIRS_USBKEYBOARD=1 +TARGET_DIRS_USBGECKO=1 endif ifdef TARGET_DIRS_NETWORK network_all: @@ -1465,51 +1465,6 @@ network: $(MAKE) -C network all .PHONY: network_all network_debug network_smart network_release network_units network_examples network_shared network_install network_sourceinstall network_exampleinstall network_distinstall network_zipinstall network_zipsourceinstall network_zipexampleinstall network_zipdistinstall network_clean network_distclean network_cleanall network_info network_makefiles network endif -ifdef TARGET_DIRS_USBGECKO -usbgecko_all: - $(MAKE) -C usbgecko all -usbgecko_debug: - $(MAKE) -C usbgecko debug -usbgecko_smart: - $(MAKE) -C usbgecko smart -usbgecko_release: - $(MAKE) -C usbgecko release -usbgecko_units: - $(MAKE) -C usbgecko units -usbgecko_examples: - $(MAKE) -C usbgecko examples -usbgecko_shared: - $(MAKE) -C usbgecko shared -usbgecko_install: - $(MAKE) -C usbgecko install -usbgecko_sourceinstall: - $(MAKE) -C usbgecko sourceinstall -usbgecko_exampleinstall: - $(MAKE) -C usbgecko exampleinstall -usbgecko_distinstall: - $(MAKE) -C usbgecko distinstall -usbgecko_zipinstall: - $(MAKE) -C usbgecko zipinstall -usbgecko_zipsourceinstall: - $(MAKE) -C usbgecko zipsourceinstall -usbgecko_zipexampleinstall: - $(MAKE) -C usbgecko zipexampleinstall -usbgecko_zipdistinstall: - $(MAKE) -C usbgecko zipdistinstall -usbgecko_clean: - $(MAKE) -C usbgecko clean -usbgecko_distclean: - $(MAKE) -C usbgecko distclean -usbgecko_cleanall: - $(MAKE) -C usbgecko cleanall -usbgecko_info: - $(MAKE) -C usbgecko info -usbgecko_makefiles: - $(MAKE) -C usbgecko makefiles -usbgecko: - $(MAKE) -C usbgecko all -.PHONY: usbgecko_all usbgecko_debug usbgecko_smart usbgecko_release usbgecko_units usbgecko_examples usbgecko_shared usbgecko_install usbgecko_sourceinstall usbgecko_exampleinstall usbgecko_distinstall usbgecko_zipinstall usbgecko_zipsourceinstall usbgecko_zipexampleinstall usbgecko_zipdistinstall usbgecko_clean usbgecko_distclean usbgecko_cleanall usbgecko_info usbgecko_makefiles usbgecko -endif ifdef TARGET_DIRS_USBKEYBOARD usbkeyboard_all: $(MAKE) -C usbkeyboard all @@ -1555,6 +1510,51 @@ usbkeyboard: $(MAKE) -C usbkeyboard all .PHONY: usbkeyboard_all usbkeyboard_debug usbkeyboard_smart usbkeyboard_release usbkeyboard_units usbkeyboard_examples usbkeyboard_shared usbkeyboard_install usbkeyboard_sourceinstall usbkeyboard_exampleinstall usbkeyboard_distinstall usbkeyboard_zipinstall usbkeyboard_zipsourceinstall usbkeyboard_zipexampleinstall usbkeyboard_zipdistinstall usbkeyboard_clean usbkeyboard_distclean usbkeyboard_cleanall usbkeyboard_info usbkeyboard_makefiles usbkeyboard endif +ifdef TARGET_DIRS_USBGECKO +usbgecko_all: + $(MAKE) -C usbgecko all +usbgecko_debug: + $(MAKE) -C usbgecko debug +usbgecko_smart: + $(MAKE) -C usbgecko smart +usbgecko_release: + $(MAKE) -C usbgecko release +usbgecko_units: + $(MAKE) -C usbgecko units +usbgecko_examples: + $(MAKE) -C usbgecko examples +usbgecko_shared: + $(MAKE) -C usbgecko shared +usbgecko_install: + $(MAKE) -C usbgecko install +usbgecko_sourceinstall: + $(MAKE) -C usbgecko sourceinstall +usbgecko_exampleinstall: + $(MAKE) -C usbgecko exampleinstall +usbgecko_distinstall: + $(MAKE) -C usbgecko distinstall +usbgecko_zipinstall: + $(MAKE) -C usbgecko zipinstall +usbgecko_zipsourceinstall: + $(MAKE) -C usbgecko zipsourceinstall +usbgecko_zipexampleinstall: + $(MAKE) -C usbgecko zipexampleinstall +usbgecko_zipdistinstall: + $(MAKE) -C usbgecko zipdistinstall +usbgecko_clean: + $(MAKE) -C usbgecko clean +usbgecko_distclean: + $(MAKE) -C usbgecko distclean +usbgecko_cleanall: + $(MAKE) -C usbgecko cleanall +usbgecko_info: + $(MAKE) -C usbgecko info +usbgecko_makefiles: + $(MAKE) -C usbgecko makefiles +usbgecko: + $(MAKE) -C usbgecko all +.PHONY: usbgecko_all usbgecko_debug usbgecko_smart usbgecko_release usbgecko_units usbgecko_examples usbgecko_shared usbgecko_install usbgecko_sourceinstall usbgecko_exampleinstall usbgecko_distinstall usbgecko_zipinstall usbgecko_zipsourceinstall usbgecko_zipexampleinstall usbgecko_zipdistinstall usbgecko_clean usbgecko_distclean usbgecko_cleanall usbgecko_info usbgecko_makefiles usbgecko +endif all: $(addsuffix _all,$(TARGET_DIRS)) debug: $(addsuffix _debug,$(TARGET_DIRS)) smart: $(addsuffix _smart,$(TARGET_DIRS)) diff --git a/packages/libogcfpc/examples/devices/Makefile.fpc b/packages/libogcfpc/examples/devices/Makefile.fpc index 34b9e012ff..79c7e6ca90 100644 --- a/packages/libogcfpc/examples/devices/Makefile.fpc +++ b/packages/libogcfpc/examples/devices/Makefile.fpc @@ -3,7 +3,7 @@ # [target] -dirs=network usbgecko usbkeyboard +dirs=network usbkeyboard usbgecko [require] packages=libogcfpc diff --git a/packages/libogcfpc/examples/devices/network/Makefile b/packages/libogcfpc/examples/devices/network/Makefile index ce39ce525b..49b8b2df9a 100644 --- a/packages/libogcfpc/examples/devices/network/Makefile +++ b/packages/libogcfpc/examples/devices/network/Makefile @@ -100,8 +100,6 @@ endif endif export ECHO endif -override OS_TARGET_DEFAULT=wii -override CPU_TARGET_DEFAULT=powerpc override DEFAULT_FPCDIR=../../../../.. ifndef FPC ifdef PP @@ -266,25 +264,10 @@ ifeq ($(UNITSDIR),) UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET)) endif PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra) -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)/*))) ifeq ($(FULL_TARGET),powerpc-wii) -override TARGET_PROGRAMS+=sockettest -endif -ifeq ($(FULL_TARGET),powerpc-wii) -override CLEAN_UNITS+=* -endif -ifeq ($(FULL_TARGET),powerpc-wii) -override CLEAN_FILES+=*.elf *.o *.s *.h *.bin *.map $(BUILD)/* $(INC)/* +override TARGET_DIRS+=sockettest endif override INSTALL_FPCPACKAGE=y -ifeq ($(FULL_TARGET),powerpc-wii) -override COMPILER_OPTIONS+=-g -Xm -endif ifdef REQUIRE_UNITSDIR override UNITSDIR+=$(REQUIRE_UNITSDIR) endif @@ -1249,171 +1232,10 @@ EXECPPAS:=@$(PPAS) endif endif endif -.PHONY: fpc_exes -ifndef CROSSINSTALL -ifneq ($(TARGET_PROGRAMS),) -override EXEFILES=$(addsuffix $(EXEEXT),$(TARGET_PROGRAMS)) -override EXEOFILES:=$(addsuffix $(OEXT),$(TARGET_PROGRAMS)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS))) $(addprefix $(IMPORTLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS))) -override ALLTARGET+=fpc_exes -override INSTALLEXEFILES+=$(EXEFILES) -override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES) -ifeq ($(OS_TARGET),os2) -override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS)) -endif -ifeq ($(OS_TARGET),emx) -override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS)) -endif -endif -endif -fpc_exes: $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) $(EXEFILES) ifdef TARGET_RSTS override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS)) override CLEANRSTFILES+=$(RSTFILES) endif -.PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared -$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET) - @$(ECHOREDIR) Compiled > $(FPCMADE) -fpc_all: $(FPCMADE) -fpc_smart: - $(MAKE) all LINKSMART=1 CREATESMART=1 -fpc_debug: - $(MAKE) all DEBUG=1 -fpc_release: - $(MAKE) all RELEASE=1 -.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .lpr .dpr .pp .rc .res -$(COMPILER_UNITTARGETDIR): - $(MKDIRTREE) $(COMPILER_UNITTARGETDIR) -$(COMPILER_TARGETDIR): - $(MKDIRTREE) $(COMPILER_TARGETDIR) -%$(PPUEXT): %.pp - $(COMPILER) $< - $(EXECPPAS) -%$(PPUEXT): %.pas - $(COMPILER) $< - $(EXECPPAS) -%$(EXEEXT): %.pp - $(COMPILER) $< - $(EXECPPAS) -%$(EXEEXT): %.pas - $(COMPILER) $< - $(EXECPPAS) -%$(EXEEXT): %.lpr - $(COMPILER) $< - $(EXECPPAS) -%$(EXEEXT): %.dpr - $(COMPILER) $< - $(EXECPPAS) -%.res: %.rc - windres -i $< -o $@ -vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) -vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) -vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) -vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) -vpath %.inc $(COMPILER_INCLUDEDIR) -vpath %$(OEXT) $(COMPILER_UNITTARGETDIR) -vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR) -.PHONY: fpc_shared -override INSTALLTARGET+=fpc_shared_install -ifndef SHARED_LIBVERSION -SHARED_LIBVERSION=$(FPC_VERSION) -endif -ifndef SHARED_LIBNAME -SHARED_LIBNAME=$(PACKAGE_NAME) -endif -ifndef SHARED_FULLNAME -SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT) -endif -ifndef SHARED_LIBUNITS -SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS) -override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS)) -endif -fpc_shared: -ifdef HASSHAREDLIB - $(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1 -ifneq ($(SHARED_BUILD),n) - $(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR) -endif -else - @$(ECHO) Shared Libraries not supported -endif -fpc_shared_install: -ifneq ($(SHARED_BUILD),n) -ifneq ($(SHARED_LIBUNITS),) -ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),) - $(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR) -endif -endif -endif -.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall -ifdef INSTALL_UNITS -override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS)) -endif -ifdef INSTALL_BUILDUNIT -override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES)) -endif -ifdef INSTALLPPUFILES -override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) -ifneq ($(UNITTARGETDIRPREFIX),) -override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES))) -override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES)))) -endif -override INSTALL_CREATEPACKAGEFPC=1 -endif -ifdef INSTALLEXEFILES -ifneq ($(TARGETDIRPREFIX),) -override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES))) -endif -endif -fpc_install: all $(INSTALLTARGET) -ifdef INSTALLEXEFILES - $(MKDIR) $(INSTALL_BINDIR) -ifdef UPXPROG - -$(UPXPROG) $(INSTALLEXEFILES) -endif - $(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR) -endif -ifdef INSTALL_CREATEPACKAGEFPC -ifdef FPCMAKE -ifdef PACKAGE_VERSION -ifneq ($(wildcard Makefile.fpc),) - $(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc - $(MKDIR) $(INSTALL_UNITDIR) - $(INSTALL) Package.fpc $(INSTALL_UNITDIR) -endif -endif -endif -endif -ifdef INSTALLPPUFILES - $(MKDIR) $(INSTALL_UNITDIR) - $(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR) -ifneq ($(INSTALLPPULINKFILES),) - $(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR) -endif -ifneq ($(wildcard $(LIB_FULLNAME)),) - $(MKDIR) $(INSTALL_LIBDIR) - $(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR) -ifdef inUnix - ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME) -endif -endif -endif -ifdef INSTALL_FILES - $(MKDIR) $(INSTALL_DATADIR) - $(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR) -endif -fpc_sourceinstall: distclean - $(MKDIR) $(INSTALL_SOURCEDIR) - $(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR) -fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS)) -ifdef HASEXAMPLES - $(MKDIR) $(INSTALL_EXAMPLEDIR) -endif -ifdef EXAMPLESOURCEFILES - $(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR) -endif -ifdef TARGET_EXAMPLEDIRS - $(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR) -endif .PHONY: fpc_clean fpc_cleanall fpc_distclean ifdef EXEFILES override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES)) @@ -1593,82 +1415,76 @@ endif fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS)) fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2 fpc_makefiles: fpc_makefile fpc_makefile_dirs -ifndef BIN2S -BIN2S:=$(strip $(wildcard $(addsuffix /bin2s$(SRCEXEEXT),$(SEARCHPATH)))) -ifeq ($(BIN2S),) -BIN2S= __missing_command_BIN2S -else -BIN2S:=$(firstword $(BIN2S)) -endif -endif -export BIN2S -ifndef RMDIR -RMDIR:=$(strip $(wildcard $(addsuffix /rmdir$(SRCEXEEXT),$(SEARCHPATH)))) -ifeq ($(RMDIR),) -RMDIR= __missing_command_RMDIR -else -RMDIR:=$(firstword $(RMDIR)) -endif -endif -export RMDIR -ifndef GXTEXCONV -GXTEXCONV:=$(strip $(wildcard $(addsuffix /gxtexconv$(SRCEXEEXT),$(SEARCHPATH)))) -ifeq ($(GXTEXCONV),) -GXTEXCONV= __missing_command_GXTEXCONV -else -GXTEXCONV:=$(firstword $(GXTEXCONV)) -endif -endif -export GXTEXCONV -debug: fpc_debug -smart: fpc_smart -release: fpc_release -units: fpc_units -examples: -shared: fpc_shared -install: fpc_install -sourceinstall: fpc_sourceinstall -exampleinstall: fpc_exampleinstall -distinstall: -zipinstall: -zipsourceinstall: -zipexampleinstall: -zipdistinstall: -distclean: fpc_distclean -cleanall: fpc_cleanall +ifeq ($(FULL_TARGET),powerpc-wii) +TARGET_DIRS_SOCKETTEST=1 +endif +ifdef TARGET_DIRS_SOCKETTEST +sockettest_all: + $(MAKE) -C sockettest all +sockettest_debug: + $(MAKE) -C sockettest debug +sockettest_smart: + $(MAKE) -C sockettest smart +sockettest_release: + $(MAKE) -C sockettest release +sockettest_units: + $(MAKE) -C sockettest units +sockettest_examples: + $(MAKE) -C sockettest examples +sockettest_shared: + $(MAKE) -C sockettest shared +sockettest_install: + $(MAKE) -C sockettest install +sockettest_sourceinstall: + $(MAKE) -C sockettest sourceinstall +sockettest_exampleinstall: + $(MAKE) -C sockettest exampleinstall +sockettest_distinstall: + $(MAKE) -C sockettest distinstall +sockettest_zipinstall: + $(MAKE) -C sockettest zipinstall +sockettest_zipsourceinstall: + $(MAKE) -C sockettest zipsourceinstall +sockettest_zipexampleinstall: + $(MAKE) -C sockettest zipexampleinstall +sockettest_zipdistinstall: + $(MAKE) -C sockettest zipdistinstall +sockettest_clean: + $(MAKE) -C sockettest clean +sockettest_distclean: + $(MAKE) -C sockettest distclean +sockettest_cleanall: + $(MAKE) -C sockettest cleanall +sockettest_info: + $(MAKE) -C sockettest info +sockettest_makefiles: + $(MAKE) -C sockettest makefiles +sockettest: + $(MAKE) -C sockettest all +.PHONY: sockettest_all sockettest_debug sockettest_smart sockettest_release sockettest_units sockettest_examples sockettest_shared sockettest_install sockettest_sourceinstall sockettest_exampleinstall sockettest_distinstall sockettest_zipinstall sockettest_zipsourceinstall sockettest_zipexampleinstall sockettest_zipdistinstall sockettest_clean sockettest_distclean sockettest_cleanall sockettest_info sockettest_makefiles sockettest +endif +all: $(addsuffix _all,$(TARGET_DIRS)) +debug: $(addsuffix _debug,$(TARGET_DIRS)) +smart: $(addsuffix _smart,$(TARGET_DIRS)) +release: $(addsuffix _release,$(TARGET_DIRS)) +units: $(addsuffix _units,$(TARGET_DIRS)) +examples: $(addsuffix _examples,$(TARGET_DIRS)) +shared: $(addsuffix _shared,$(TARGET_DIRS)) +install: $(addsuffix _install,$(TARGET_DIRS)) +sourceinstall: $(addsuffix _sourceinstall,$(TARGET_DIRS)) +exampleinstall: $(addsuffix _exampleinstall,$(TARGET_DIRS)) +distinstall: $(addsuffix _distinstall,$(TARGET_DIRS)) +zipinstall: $(addsuffix _zipinstall,$(TARGET_DIRS)) +zipsourceinstall: $(addsuffix _zipsourceinstall,$(TARGET_DIRS)) +zipexampleinstall: $(addsuffix _zipexampleinstall,$(TARGET_DIRS)) +zipdistinstall: $(addsuffix _zipdistinstall,$(TARGET_DIRS)) +clean: $(addsuffix _clean,$(TARGET_DIRS)) +distclean: $(addsuffix _distclean,$(TARGET_DIRS)) +cleanall: $(addsuffix _cleanall,$(TARGET_DIRS)) info: fpc_info -makefiles: fpc_makefiles -.PHONY: debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall distclean cleanall info makefiles +makefiles: fpc_makefiles $(addsuffix _makefiles,$(TARGET_DIRS)) +.PHONY: all debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles 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 -dir_delete: - @$(DELTREE) $(CURDIR)/$(BUILD) - @$(DELTREE) $(CURDIR)/$(INC) -dir_make: -ifneq ($(BUILD), $(CURDIR)) - @$(MKDIR) $(BUILD) -endif -ifneq ($(INC), $(CURDIR)) - @$(MKDIR) $(INC) -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!' diff --git a/packages/libogcfpc/examples/devices/network/Makefile.fpc b/packages/libogcfpc/examples/devices/network/Makefile.fpc index 4efa10a9ce..638eb95cc6 100644 --- a/packages/libogcfpc/examples/devices/network/Makefile.fpc +++ b/packages/libogcfpc/examples/devices/network/Makefile.fpc @@ -12,7 +12,7 @@ packages=libogcfpc fpcpackage=y [default] -fpcdir=../../../.. +fpcdir=../../../../.. [rules] .NOTPARALLEL: diff --git a/packages/libogcfpc/examples/devices/usbgecko/Makefile b/packages/libogcfpc/examples/devices/usbgecko/Makefile index 78568ff95a..00745f8599 100644 --- a/packages/libogcfpc/examples/devices/usbgecko/Makefile +++ b/packages/libogcfpc/examples/devices/usbgecko/Makefile @@ -100,8 +100,6 @@ endif endif export ECHO endif -override OS_TARGET_DEFAULT=wii -override CPU_TARGET_DEFAULT=powerpc override DEFAULT_FPCDIR=../../../../.. ifndef FPC ifdef PP @@ -266,25 +264,10 @@ ifeq ($(UNITSDIR),) UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET)) endif PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra) -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)/*))) ifeq ($(FULL_TARGET),powerpc-wii) -override TARGET_PROGRAMS+=gdbstub -endif -ifeq ($(FULL_TARGET),powerpc-wii) -override CLEAN_UNITS+=* -endif -ifeq ($(FULL_TARGET),powerpc-wii) -override CLEAN_FILES+=*.elf *.o *.s *.h *.bin *.map $(BUILD)/* $(INC)/* +override TARGET_DIRS+=gdbstub endif override INSTALL_FPCPACKAGE=y -ifeq ($(FULL_TARGET),powerpc-wii) -override COMPILER_OPTIONS+=-g -Xm -endif ifdef REQUIRE_UNITSDIR override UNITSDIR+=$(REQUIRE_UNITSDIR) endif @@ -1249,171 +1232,10 @@ EXECPPAS:=@$(PPAS) endif endif endif -.PHONY: fpc_exes -ifndef CROSSINSTALL -ifneq ($(TARGET_PROGRAMS),) -override EXEFILES=$(addsuffix $(EXEEXT),$(TARGET_PROGRAMS)) -override EXEOFILES:=$(addsuffix $(OEXT),$(TARGET_PROGRAMS)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS))) $(addprefix $(IMPORTLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS))) -override ALLTARGET+=fpc_exes -override INSTALLEXEFILES+=$(EXEFILES) -override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES) -ifeq ($(OS_TARGET),os2) -override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS)) -endif -ifeq ($(OS_TARGET),emx) -override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS)) -endif -endif -endif -fpc_exes: $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) $(EXEFILES) ifdef TARGET_RSTS override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS)) override CLEANRSTFILES+=$(RSTFILES) endif -.PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared -$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET) - @$(ECHOREDIR) Compiled > $(FPCMADE) -fpc_all: $(FPCMADE) -fpc_smart: - $(MAKE) all LINKSMART=1 CREATESMART=1 -fpc_debug: - $(MAKE) all DEBUG=1 -fpc_release: - $(MAKE) all RELEASE=1 -.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .lpr .dpr .pp .rc .res -$(COMPILER_UNITTARGETDIR): - $(MKDIRTREE) $(COMPILER_UNITTARGETDIR) -$(COMPILER_TARGETDIR): - $(MKDIRTREE) $(COMPILER_TARGETDIR) -%$(PPUEXT): %.pp - $(COMPILER) $< - $(EXECPPAS) -%$(PPUEXT): %.pas - $(COMPILER) $< - $(EXECPPAS) -%$(EXEEXT): %.pp - $(COMPILER) $< - $(EXECPPAS) -%$(EXEEXT): %.pas - $(COMPILER) $< - $(EXECPPAS) -%$(EXEEXT): %.lpr - $(COMPILER) $< - $(EXECPPAS) -%$(EXEEXT): %.dpr - $(COMPILER) $< - $(EXECPPAS) -%.res: %.rc - windres -i $< -o $@ -vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) -vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) -vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) -vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) -vpath %.inc $(COMPILER_INCLUDEDIR) -vpath %$(OEXT) $(COMPILER_UNITTARGETDIR) -vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR) -.PHONY: fpc_shared -override INSTALLTARGET+=fpc_shared_install -ifndef SHARED_LIBVERSION -SHARED_LIBVERSION=$(FPC_VERSION) -endif -ifndef SHARED_LIBNAME -SHARED_LIBNAME=$(PACKAGE_NAME) -endif -ifndef SHARED_FULLNAME -SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT) -endif -ifndef SHARED_LIBUNITS -SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS) -override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS)) -endif -fpc_shared: -ifdef HASSHAREDLIB - $(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1 -ifneq ($(SHARED_BUILD),n) - $(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR) -endif -else - @$(ECHO) Shared Libraries not supported -endif -fpc_shared_install: -ifneq ($(SHARED_BUILD),n) -ifneq ($(SHARED_LIBUNITS),) -ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),) - $(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR) -endif -endif -endif -.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall -ifdef INSTALL_UNITS -override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS)) -endif -ifdef INSTALL_BUILDUNIT -override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES)) -endif -ifdef INSTALLPPUFILES -override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) -ifneq ($(UNITTARGETDIRPREFIX),) -override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES))) -override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES)))) -endif -override INSTALL_CREATEPACKAGEFPC=1 -endif -ifdef INSTALLEXEFILES -ifneq ($(TARGETDIRPREFIX),) -override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES))) -endif -endif -fpc_install: all $(INSTALLTARGET) -ifdef INSTALLEXEFILES - $(MKDIR) $(INSTALL_BINDIR) -ifdef UPXPROG - -$(UPXPROG) $(INSTALLEXEFILES) -endif - $(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR) -endif -ifdef INSTALL_CREATEPACKAGEFPC -ifdef FPCMAKE -ifdef PACKAGE_VERSION -ifneq ($(wildcard Makefile.fpc),) - $(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc - $(MKDIR) $(INSTALL_UNITDIR) - $(INSTALL) Package.fpc $(INSTALL_UNITDIR) -endif -endif -endif -endif -ifdef INSTALLPPUFILES - $(MKDIR) $(INSTALL_UNITDIR) - $(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR) -ifneq ($(INSTALLPPULINKFILES),) - $(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR) -endif -ifneq ($(wildcard $(LIB_FULLNAME)),) - $(MKDIR) $(INSTALL_LIBDIR) - $(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR) -ifdef inUnix - ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME) -endif -endif -endif -ifdef INSTALL_FILES - $(MKDIR) $(INSTALL_DATADIR) - $(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR) -endif -fpc_sourceinstall: distclean - $(MKDIR) $(INSTALL_SOURCEDIR) - $(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR) -fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS)) -ifdef HASEXAMPLES - $(MKDIR) $(INSTALL_EXAMPLEDIR) -endif -ifdef EXAMPLESOURCEFILES - $(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR) -endif -ifdef TARGET_EXAMPLEDIRS - $(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR) -endif .PHONY: fpc_clean fpc_cleanall fpc_distclean ifdef EXEFILES override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES)) @@ -1593,82 +1415,76 @@ endif fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS)) fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2 fpc_makefiles: fpc_makefile fpc_makefile_dirs -ifndef BIN2S -BIN2S:=$(strip $(wildcard $(addsuffix /bin2s$(SRCEXEEXT),$(SEARCHPATH)))) -ifeq ($(BIN2S),) -BIN2S= __missing_command_BIN2S -else -BIN2S:=$(firstword $(BIN2S)) -endif -endif -export BIN2S -ifndef RMDIR -RMDIR:=$(strip $(wildcard $(addsuffix /rmdir$(SRCEXEEXT),$(SEARCHPATH)))) -ifeq ($(RMDIR),) -RMDIR= __missing_command_RMDIR -else -RMDIR:=$(firstword $(RMDIR)) -endif -endif -export RMDIR -ifndef GXTEXCONV -GXTEXCONV:=$(strip $(wildcard $(addsuffix /gxtexconv$(SRCEXEEXT),$(SEARCHPATH)))) -ifeq ($(GXTEXCONV),) -GXTEXCONV= __missing_command_GXTEXCONV -else -GXTEXCONV:=$(firstword $(GXTEXCONV)) -endif -endif -export GXTEXCONV -debug: fpc_debug -smart: fpc_smart -release: fpc_release -units: fpc_units -examples: -shared: fpc_shared -install: fpc_install -sourceinstall: fpc_sourceinstall -exampleinstall: fpc_exampleinstall -distinstall: -zipinstall: -zipsourceinstall: -zipexampleinstall: -zipdistinstall: -distclean: fpc_distclean -cleanall: fpc_cleanall +ifeq ($(FULL_TARGET),powerpc-wii) +TARGET_DIRS_GDBSTUB=1 +endif +ifdef TARGET_DIRS_GDBSTUB +gdbstub_all: + $(MAKE) -C gdbstub all +gdbstub_debug: + $(MAKE) -C gdbstub debug +gdbstub_smart: + $(MAKE) -C gdbstub smart +gdbstub_release: + $(MAKE) -C gdbstub release +gdbstub_units: + $(MAKE) -C gdbstub units +gdbstub_examples: + $(MAKE) -C gdbstub examples +gdbstub_shared: + $(MAKE) -C gdbstub shared +gdbstub_install: + $(MAKE) -C gdbstub install +gdbstub_sourceinstall: + $(MAKE) -C gdbstub sourceinstall +gdbstub_exampleinstall: + $(MAKE) -C gdbstub exampleinstall +gdbstub_distinstall: + $(MAKE) -C gdbstub distinstall +gdbstub_zipinstall: + $(MAKE) -C gdbstub zipinstall +gdbstub_zipsourceinstall: + $(MAKE) -C gdbstub zipsourceinstall +gdbstub_zipexampleinstall: + $(MAKE) -C gdbstub zipexampleinstall +gdbstub_zipdistinstall: + $(MAKE) -C gdbstub zipdistinstall +gdbstub_clean: + $(MAKE) -C gdbstub clean +gdbstub_distclean: + $(MAKE) -C gdbstub distclean +gdbstub_cleanall: + $(MAKE) -C gdbstub cleanall +gdbstub_info: + $(MAKE) -C gdbstub info +gdbstub_makefiles: + $(MAKE) -C gdbstub makefiles +gdbstub: + $(MAKE) -C gdbstub all +.PHONY: gdbstub_all gdbstub_debug gdbstub_smart gdbstub_release gdbstub_units gdbstub_examples gdbstub_shared gdbstub_install gdbstub_sourceinstall gdbstub_exampleinstall gdbstub_distinstall gdbstub_zipinstall gdbstub_zipsourceinstall gdbstub_zipexampleinstall gdbstub_zipdistinstall gdbstub_clean gdbstub_distclean gdbstub_cleanall gdbstub_info gdbstub_makefiles gdbstub +endif +all: $(addsuffix _all,$(TARGET_DIRS)) +debug: $(addsuffix _debug,$(TARGET_DIRS)) +smart: $(addsuffix _smart,$(TARGET_DIRS)) +release: $(addsuffix _release,$(TARGET_DIRS)) +units: $(addsuffix _units,$(TARGET_DIRS)) +examples: $(addsuffix _examples,$(TARGET_DIRS)) +shared: $(addsuffix _shared,$(TARGET_DIRS)) +install: $(addsuffix _install,$(TARGET_DIRS)) +sourceinstall: $(addsuffix _sourceinstall,$(TARGET_DIRS)) +exampleinstall: $(addsuffix _exampleinstall,$(TARGET_DIRS)) +distinstall: $(addsuffix _distinstall,$(TARGET_DIRS)) +zipinstall: $(addsuffix _zipinstall,$(TARGET_DIRS)) +zipsourceinstall: $(addsuffix _zipsourceinstall,$(TARGET_DIRS)) +zipexampleinstall: $(addsuffix _zipexampleinstall,$(TARGET_DIRS)) +zipdistinstall: $(addsuffix _zipdistinstall,$(TARGET_DIRS)) +clean: $(addsuffix _clean,$(TARGET_DIRS)) +distclean: $(addsuffix _distclean,$(TARGET_DIRS)) +cleanall: $(addsuffix _cleanall,$(TARGET_DIRS)) info: fpc_info -makefiles: fpc_makefiles -.PHONY: debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall distclean cleanall info makefiles +makefiles: fpc_makefiles $(addsuffix _makefiles,$(TARGET_DIRS)) +.PHONY: all debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles 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 -dir_delete: - @$(DELTREE) $(CURDIR)/$(BUILD) - @$(DELTREE) $(CURDIR)/$(INC) -dir_make: -ifneq ($(BUILD), $(CURDIR)) - @$(MKDIR) $(BUILD) -endif -ifneq ($(INC), $(CURDIR)) - @$(MKDIR) $(INC) -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!' diff --git a/packages/libogcfpc/examples/devices/usbgecko/Makefile.fpc b/packages/libogcfpc/examples/devices/usbgecko/Makefile.fpc index e2fab919b0..cb03ed235d 100644 --- a/packages/libogcfpc/examples/devices/usbgecko/Makefile.fpc +++ b/packages/libogcfpc/examples/devices/usbgecko/Makefile.fpc @@ -12,7 +12,7 @@ packages=libogcfpc fpcpackage=y [default] -fpcdir=../../../.. +fpcdir=../../../../.. [rules] .NOTPARALLEL: diff --git a/packages/libogcfpc/examples/devices/usbgecko/gdbstub/Makefile b/packages/libogcfpc/examples/devices/usbgecko/gdbstub/Makefile index 5dc815f6a8..f4c0130786 100644 --- a/packages/libogcfpc/examples/devices/usbgecko/gdbstub/Makefile +++ b/packages/libogcfpc/examples/devices/usbgecko/gdbstub/Makefile @@ -283,7 +283,7 @@ override CLEAN_FILES+=*.elf *.o *.s *.h *.bin *.map $(BUILD)/* $(INC)/* endif override INSTALL_FPCPACKAGE=y ifeq ($(FULL_TARGET),powerpc-wii) -override COMPILER_OPTIONS+=-g -Xm +override COMPILER_OPTIONS+=-g -Xm -k--gc-sections endif ifdef REQUIRE_UNITSDIR override UNITSDIR+=$(REQUIRE_UNITSDIR) diff --git a/packages/libogcfpc/examples/devices/usbgecko/gdbstub/Makefile.fpc b/packages/libogcfpc/examples/devices/usbgecko/gdbstub/Makefile.fpc index 663e5ecc99..271ccac6fa 100644 --- a/packages/libogcfpc/examples/devices/usbgecko/gdbstub/Makefile.fpc +++ b/packages/libogcfpc/examples/devices/usbgecko/gdbstub/Makefile.fpc @@ -20,7 +20,7 @@ target=wii fpcdir=../../../../../.. [compiler] -options=-g -Xm +options=-g -Xm -k--gc-sections [clean] files=*.elf *.o *.s *.h *.bin *.map \ diff --git a/packages/libogcfpc/examples/devices/usbkeyboard/Makefile b/packages/libogcfpc/examples/devices/usbkeyboard/Makefile index 03533187c9..f65f03b190 100644 --- a/packages/libogcfpc/examples/devices/usbkeyboard/Makefile +++ b/packages/libogcfpc/examples/devices/usbkeyboard/Makefile @@ -100,8 +100,6 @@ endif endif export ECHO endif -override OS_TARGET_DEFAULT=wii -override CPU_TARGET_DEFAULT=powerpc override DEFAULT_FPCDIR=../../../../.. ifndef FPC ifdef PP @@ -266,25 +264,10 @@ ifeq ($(UNITSDIR),) UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET)) endif PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra) -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)/*))) ifeq ($(FULL_TARGET),powerpc-wii) -override TARGET_PROGRAMS+=basic_stdin -endif -ifeq ($(FULL_TARGET),powerpc-wii) -override CLEAN_UNITS+=* -endif -ifeq ($(FULL_TARGET),powerpc-wii) -override CLEAN_FILES+=*.elf *.o *.s *.h *.bin *.map $(BUILD)/* $(INC)/* +override TARGET_DIRS+=basic_stdin endif override INSTALL_FPCPACKAGE=y -ifeq ($(FULL_TARGET),powerpc-wii) -override COMPILER_OPTIONS+=-g -Xm -endif ifdef REQUIRE_UNITSDIR override UNITSDIR+=$(REQUIRE_UNITSDIR) endif @@ -1249,171 +1232,10 @@ EXECPPAS:=@$(PPAS) endif endif endif -.PHONY: fpc_exes -ifndef CROSSINSTALL -ifneq ($(TARGET_PROGRAMS),) -override EXEFILES=$(addsuffix $(EXEEXT),$(TARGET_PROGRAMS)) -override EXEOFILES:=$(addsuffix $(OEXT),$(TARGET_PROGRAMS)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS))) $(addprefix $(IMPORTLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS))) -override ALLTARGET+=fpc_exes -override INSTALLEXEFILES+=$(EXEFILES) -override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES) -ifeq ($(OS_TARGET),os2) -override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS)) -endif -ifeq ($(OS_TARGET),emx) -override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS)) -endif -endif -endif -fpc_exes: $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) $(EXEFILES) ifdef TARGET_RSTS override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS)) override CLEANRSTFILES+=$(RSTFILES) endif -.PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared -$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET) - @$(ECHOREDIR) Compiled > $(FPCMADE) -fpc_all: $(FPCMADE) -fpc_smart: - $(MAKE) all LINKSMART=1 CREATESMART=1 -fpc_debug: - $(MAKE) all DEBUG=1 -fpc_release: - $(MAKE) all RELEASE=1 -.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .lpr .dpr .pp .rc .res -$(COMPILER_UNITTARGETDIR): - $(MKDIRTREE) $(COMPILER_UNITTARGETDIR) -$(COMPILER_TARGETDIR): - $(MKDIRTREE) $(COMPILER_TARGETDIR) -%$(PPUEXT): %.pp - $(COMPILER) $< - $(EXECPPAS) -%$(PPUEXT): %.pas - $(COMPILER) $< - $(EXECPPAS) -%$(EXEEXT): %.pp - $(COMPILER) $< - $(EXECPPAS) -%$(EXEEXT): %.pas - $(COMPILER) $< - $(EXECPPAS) -%$(EXEEXT): %.lpr - $(COMPILER) $< - $(EXECPPAS) -%$(EXEEXT): %.dpr - $(COMPILER) $< - $(EXECPPAS) -%.res: %.rc - windres -i $< -o $@ -vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) -vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) -vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) -vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) -vpath %.inc $(COMPILER_INCLUDEDIR) -vpath %$(OEXT) $(COMPILER_UNITTARGETDIR) -vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR) -.PHONY: fpc_shared -override INSTALLTARGET+=fpc_shared_install -ifndef SHARED_LIBVERSION -SHARED_LIBVERSION=$(FPC_VERSION) -endif -ifndef SHARED_LIBNAME -SHARED_LIBNAME=$(PACKAGE_NAME) -endif -ifndef SHARED_FULLNAME -SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT) -endif -ifndef SHARED_LIBUNITS -SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS) -override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS)) -endif -fpc_shared: -ifdef HASSHAREDLIB - $(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1 -ifneq ($(SHARED_BUILD),n) - $(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR) -endif -else - @$(ECHO) Shared Libraries not supported -endif -fpc_shared_install: -ifneq ($(SHARED_BUILD),n) -ifneq ($(SHARED_LIBUNITS),) -ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),) - $(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR) -endif -endif -endif -.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall -ifdef INSTALL_UNITS -override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS)) -endif -ifdef INSTALL_BUILDUNIT -override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES)) -endif -ifdef INSTALLPPUFILES -override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) -ifneq ($(UNITTARGETDIRPREFIX),) -override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES))) -override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES)))) -endif -override INSTALL_CREATEPACKAGEFPC=1 -endif -ifdef INSTALLEXEFILES -ifneq ($(TARGETDIRPREFIX),) -override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES))) -endif -endif -fpc_install: all $(INSTALLTARGET) -ifdef INSTALLEXEFILES - $(MKDIR) $(INSTALL_BINDIR) -ifdef UPXPROG - -$(UPXPROG) $(INSTALLEXEFILES) -endif - $(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR) -endif -ifdef INSTALL_CREATEPACKAGEFPC -ifdef FPCMAKE -ifdef PACKAGE_VERSION -ifneq ($(wildcard Makefile.fpc),) - $(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc - $(MKDIR) $(INSTALL_UNITDIR) - $(INSTALL) Package.fpc $(INSTALL_UNITDIR) -endif -endif -endif -endif -ifdef INSTALLPPUFILES - $(MKDIR) $(INSTALL_UNITDIR) - $(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR) -ifneq ($(INSTALLPPULINKFILES),) - $(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR) -endif -ifneq ($(wildcard $(LIB_FULLNAME)),) - $(MKDIR) $(INSTALL_LIBDIR) - $(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR) -ifdef inUnix - ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME) -endif -endif -endif -ifdef INSTALL_FILES - $(MKDIR) $(INSTALL_DATADIR) - $(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR) -endif -fpc_sourceinstall: distclean - $(MKDIR) $(INSTALL_SOURCEDIR) - $(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR) -fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS)) -ifdef HASEXAMPLES - $(MKDIR) $(INSTALL_EXAMPLEDIR) -endif -ifdef EXAMPLESOURCEFILES - $(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR) -endif -ifdef TARGET_EXAMPLEDIRS - $(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR) -endif .PHONY: fpc_clean fpc_cleanall fpc_distclean ifdef EXEFILES override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES)) @@ -1593,82 +1415,76 @@ endif fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS)) fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2 fpc_makefiles: fpc_makefile fpc_makefile_dirs -ifndef BIN2S -BIN2S:=$(strip $(wildcard $(addsuffix /bin2s$(SRCEXEEXT),$(SEARCHPATH)))) -ifeq ($(BIN2S),) -BIN2S= __missing_command_BIN2S -else -BIN2S:=$(firstword $(BIN2S)) -endif -endif -export BIN2S -ifndef RMDIR -RMDIR:=$(strip $(wildcard $(addsuffix /rmdir$(SRCEXEEXT),$(SEARCHPATH)))) -ifeq ($(RMDIR),) -RMDIR= __missing_command_RMDIR -else -RMDIR:=$(firstword $(RMDIR)) -endif -endif -export RMDIR -ifndef GXTEXCONV -GXTEXCONV:=$(strip $(wildcard $(addsuffix /gxtexconv$(SRCEXEEXT),$(SEARCHPATH)))) -ifeq ($(GXTEXCONV),) -GXTEXCONV= __missing_command_GXTEXCONV -else -GXTEXCONV:=$(firstword $(GXTEXCONV)) -endif -endif -export GXTEXCONV -debug: fpc_debug -smart: fpc_smart -release: fpc_release -units: fpc_units -examples: -shared: fpc_shared -install: fpc_install -sourceinstall: fpc_sourceinstall -exampleinstall: fpc_exampleinstall -distinstall: -zipinstall: -zipsourceinstall: -zipexampleinstall: -zipdistinstall: -distclean: fpc_distclean -cleanall: fpc_cleanall +ifeq ($(FULL_TARGET),powerpc-wii) +TARGET_DIRS_BASIC_STDIN=1 +endif +ifdef TARGET_DIRS_BASIC_STDIN +basic_stdin_all: + $(MAKE) -C basic_stdin all +basic_stdin_debug: + $(MAKE) -C basic_stdin debug +basic_stdin_smart: + $(MAKE) -C basic_stdin smart +basic_stdin_release: + $(MAKE) -C basic_stdin release +basic_stdin_units: + $(MAKE) -C basic_stdin units +basic_stdin_examples: + $(MAKE) -C basic_stdin examples +basic_stdin_shared: + $(MAKE) -C basic_stdin shared +basic_stdin_install: + $(MAKE) -C basic_stdin install +basic_stdin_sourceinstall: + $(MAKE) -C basic_stdin sourceinstall +basic_stdin_exampleinstall: + $(MAKE) -C basic_stdin exampleinstall +basic_stdin_distinstall: + $(MAKE) -C basic_stdin distinstall +basic_stdin_zipinstall: + $(MAKE) -C basic_stdin zipinstall +basic_stdin_zipsourceinstall: + $(MAKE) -C basic_stdin zipsourceinstall +basic_stdin_zipexampleinstall: + $(MAKE) -C basic_stdin zipexampleinstall +basic_stdin_zipdistinstall: + $(MAKE) -C basic_stdin zipdistinstall +basic_stdin_clean: + $(MAKE) -C basic_stdin clean +basic_stdin_distclean: + $(MAKE) -C basic_stdin distclean +basic_stdin_cleanall: + $(MAKE) -C basic_stdin cleanall +basic_stdin_info: + $(MAKE) -C basic_stdin info +basic_stdin_makefiles: + $(MAKE) -C basic_stdin makefiles +basic_stdin: + $(MAKE) -C basic_stdin all +.PHONY: basic_stdin_all basic_stdin_debug basic_stdin_smart basic_stdin_release basic_stdin_units basic_stdin_examples basic_stdin_shared basic_stdin_install basic_stdin_sourceinstall basic_stdin_exampleinstall basic_stdin_distinstall basic_stdin_zipinstall basic_stdin_zipsourceinstall basic_stdin_zipexampleinstall basic_stdin_zipdistinstall basic_stdin_clean basic_stdin_distclean basic_stdin_cleanall basic_stdin_info basic_stdin_makefiles basic_stdin +endif +all: $(addsuffix _all,$(TARGET_DIRS)) +debug: $(addsuffix _debug,$(TARGET_DIRS)) +smart: $(addsuffix _smart,$(TARGET_DIRS)) +release: $(addsuffix _release,$(TARGET_DIRS)) +units: $(addsuffix _units,$(TARGET_DIRS)) +examples: $(addsuffix _examples,$(TARGET_DIRS)) +shared: $(addsuffix _shared,$(TARGET_DIRS)) +install: $(addsuffix _install,$(TARGET_DIRS)) +sourceinstall: $(addsuffix _sourceinstall,$(TARGET_DIRS)) +exampleinstall: $(addsuffix _exampleinstall,$(TARGET_DIRS)) +distinstall: $(addsuffix _distinstall,$(TARGET_DIRS)) +zipinstall: $(addsuffix _zipinstall,$(TARGET_DIRS)) +zipsourceinstall: $(addsuffix _zipsourceinstall,$(TARGET_DIRS)) +zipexampleinstall: $(addsuffix _zipexampleinstall,$(TARGET_DIRS)) +zipdistinstall: $(addsuffix _zipdistinstall,$(TARGET_DIRS)) +clean: $(addsuffix _clean,$(TARGET_DIRS)) +distclean: $(addsuffix _distclean,$(TARGET_DIRS)) +cleanall: $(addsuffix _cleanall,$(TARGET_DIRS)) info: fpc_info -makefiles: fpc_makefiles -.PHONY: debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall distclean cleanall info makefiles +makefiles: fpc_makefiles $(addsuffix _makefiles,$(TARGET_DIRS)) +.PHONY: all debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles 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 -dir_delete: - @$(DELTREE) $(CURDIR)/$(BUILD) - @$(DELTREE) $(CURDIR)/$(INC) -dir_make: -ifneq ($(BUILD), $(CURDIR)) - @$(MKDIR) $(BUILD) -endif -ifneq ($(INC), $(CURDIR)) - @$(MKDIR) $(INC) -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!' diff --git a/packages/libogcfpc/examples/devices/usbkeyboard/Makefile.fpc b/packages/libogcfpc/examples/devices/usbkeyboard/Makefile.fpc index 0790db9766..257dd468e4 100644 --- a/packages/libogcfpc/examples/devices/usbkeyboard/Makefile.fpc +++ b/packages/libogcfpc/examples/devices/usbkeyboard/Makefile.fpc @@ -12,7 +12,7 @@ packages=libogcfpc fpcpackage=y [default] -fpcdir=../../../.. +fpcdir=../../../../.. [rules] .NOTPARALLEL: 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; |
