diff options
author | John Tytgat <joty@netsurf-browser.org> | 2008-08-06 21:46:53 +0000 |
---|---|---|
committer | John Tytgat <joty@netsurf-browser.org> | 2008-08-06 21:46:53 +0000 |
commit | 15eb877a4c6b002968db7fce279d7ad093e4d121 (patch) | |
tree | 6c7ff3363309e0927cf8de417725585d3e7ea3f3 /Makefile | |
parent | 114f948f36cbfa3e8a537ed1cd43256802e75a09 (diff) | |
download | netsurf-15eb877a4c6b002968db7fce279d7ad093e4d121.tar.gz netsurf-15eb877a4c6b002968db7fce279d7ad093e4d121.tar.bz2 |
Use ccres (http://www.riscos.info/index.php/CCres) to compile textual
versions of our Templates to their binary versions. This allows us during
the build to conditionally enable/disable certain icons or change the
icon representation.
Change made by jmb & joty.
svn path=/trunk/netsurf/; revision=4929
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 41 |
1 files changed, 41 insertions, 0 deletions
@@ -106,6 +106,8 @@ ifeq ($(TARGET),riscos) ifeq ($(HOST),riscos) # Build for RO on RO GCCSDK_INSTALL_ENV := <NSLibs$$Dir> + CCRES := ccres + TPLEXT := CC := gcc EXEEXT := PKG_CONFIG := @@ -114,6 +116,8 @@ ifeq ($(TARGET),riscos) # either using GCCSDK 4 - ELF) GCCSDK_INSTALL_ENV ?= /home/riscos/env GCCSDK_INSTALL_CROSSBIN ?= /home/riscos/cross/bin + CCRES := $(GCCSDK_INSTALL_CROSSBIN)/ccres + TPLEXT := ,fec CC := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*gcc) ifneq (,$(findstring arm-unknown-riscos-gcc,$(CC))) SUBTARGET := -elf @@ -297,6 +301,11 @@ endif # ---------------------------------------------------------------------------- ifeq ($(TARGET),riscos) + TPD_RISCOS = $(foreach TPL,$(notdir $(TPL_RISCOS)), \ + !NetSurf/Resources/$(TPL)/Templates$(TPLEXT)) + + RESOURCES = $(TPD_RISCOS) + CFLAGS += -I. $(OPTFLAGS) $(WARNFLAGS) -Driscos \ -std=c99 -D_BSD_SOURCE -D_POSIX_C_SOURCE \ -mpoke-function-name @@ -462,6 +471,38 @@ $(RSRC_BEOS): $(RDEF_BEOS) $(RDEP_BEOS) $(Q)$(BEOS_RC) -o $@ $< endif +ifeq ($(TARGET),riscos) + # Native RO build is different as 1) it can't do piping and 2) ccres on + # RO does not understand Unix filespec + ifeq ($(HOST),riscos) + define compile_template +!NetSurf/Resources/$(1)/Templates$$(TPLEXT): $(2) + $$(VQ)echo "TEMPLATE: $(2)" + $$(Q)$$(CC) -x c -E -P $$(CFLAGS) $(2) > processed_template + $$(Q)$$(CCRES) processed_template $$(subst /,.,$$@) + $$(Q)$(RM) processed_template +CLEAN_TEMPLATES += !NetSurf/Resources/$(1)/Templates$$(TPLEXT) + + endef + else + define compile_template +!NetSurf/Resources/$(1)/Templates$$(TPLEXT): $(2) + $$(VQ)echo "TEMPLATE: $(2)" + $$(Q)$$(CC) -x c -E -P $$(CFLAGS) $(2) | $$(CCRES) - $$@ +CLEAN_TEMPLATES += !NetSurf/Resources/$(1)/Templates$$(TPLEXT) + + endef + endif + +clean-templates: + $(VQ)echo " CLEAN: $(CLEAN_TEMPLATES)" + $(Q)$(RM) $(CLEAN_TEMPLATES) +CLEANS += clean-templates + +$(eval $(foreach TPL,$(TPL_RISCOS), \ + $(call compile_template,$(notdir $(TPL)),$(TPL)))) +endif + clean-target: $(VQ)echo " CLEAN: $(EXETARGET)" $(Q)$(RM) $(EXETARGET) |