Move some RISc OS specific Makefile rules into its Makefile.target

This commit is contained in:
Vincent Sanders 2015-04-05 14:52:45 +01:00
parent ea9a2ff01d
commit 2f2a73beea
2 changed files with 40 additions and 52 deletions

View File

@ -633,39 +633,6 @@ $(RSRC_BEOS): $(RDEF_BEOS) $(RDEF_IMP_BEOS)
$(Q)$(BEOS_RC) -I beos -o $@ $^ $(Q)$(BEOS_RC) -I beos -o $@ $^
endif 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) -o processed_template $(2)
$$(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)mkdir -p !NetSurf/Resources/$(1)
$$(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: clean-target:
$(VQ)echo " CLEAN: $(EXETARGET)" $(VQ)echo " CLEAN: $(EXETARGET)"
$(Q)$(RM) $(EXETARGET) $(Q)$(RM) $(EXETARGET)

View File

@ -20,22 +20,18 @@ $(eval $(call feature_enabled,DRAW,-DWITH_DRAW,,Drawfile rendering))
$(eval $(call feature_enabled,SPRITE,-DWITH_SPRITE,,Sprite rendering)) $(eval $(call feature_enabled,SPRITE,-DWITH_SPRITE,,Sprite rendering))
$(eval $(call feature_enabled,ARTWORKS,-DWITH_ARTWORKS,,ArtWorks rendering)) $(eval $(call feature_enabled,ARTWORKS,-DWITH_ARTWORKS,,ArtWorks rendering))
$(eval $(call feature_enabled,DRAW_EXPORT,-DWITH_DRAW_EXPORT,-lpencil,Drawfile export)) $(eval $(call feature_enabled,DRAW_EXPORT,-DWITH_DRAW_EXPORT,-lpencil,Drawfile export))
ifeq ($(HOST),riscos)
$(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp))) NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
$(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif))) NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
$(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) )) NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
else NETSURF_FEATURE_JS_CFLAGS := -DWITH_JS -DJS_HAS_FILE_OBJECT=0
NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP NETSURF_FEATURE_MOZJS_CFLAGS := -DWITH_MOZJS -DJS_HAS_FILE_OBJECT=0
NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF $(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG $(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
NETSURF_FEATURE_JS_CFLAGS := -DWITH_JS -DJS_HAS_FILE_OBJECT=0 $(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG ))
NETSURF_FEATURE_MOZJS_CFLAGS := -DWITH_MOZJS -DJS_HAS_FILE_OBJECT=0 $(eval $(call pkg_config_find_and_add_enabled,MOZJS,mozjs185,JavaScript))
$(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP)) $(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
$(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
$(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG ))
$(eval $(call pkg_config_find_and_add_enabled,MOZJS,mozjs185,JavaScript))
$(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
endif
TPD_RISCOS = $(foreach TPL,$(notdir $(TPL_RISCOS)), \ TPD_RISCOS = $(foreach TPL,$(notdir $(TPL_RISCOS)), \
!NetSurf/Resources/$(TPL)/Templates$(TPLEXT)) !NetSurf/Resources/$(TPL)/Templates$(TPLEXT))
@ -85,14 +81,12 @@ S_RISCOS := 401login.c assert.c bitmap.c buffer.c cookies.c configure.c \
con_fonts.c con_home.c con_image.c con_inter.c con_language.c \ con_fonts.c con_home.c con_image.c con_inter.c con_language.c \
con_secure.c con_theme.c) con_secure.c con_theme.c)
S_RISCOS := $(addprefix riscos/,$(S_RISCOS)) S_RISCOS := $(addprefix riscos/,$(S_RISCOS))
TPL_RISCOS := de en fr nl # TODO: It'd be nice to auto-detect these
TPL_RISCOS := $(addprefix riscos/templates/,$(TPL_RISCOS))
# This is the final source build list # This is the final source build list
# Note this is deliberately *not* expanded here as common and image # Note this is deliberately *not* expanded here as common and image
# are not yet available # are not yet available
SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_RISCOS) SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_RISCOS)
EXETARGET := !NetSurf/!RunImage$(EXEEXT) EXETARGET := !NetSurf/!RunImage$(EXEEXT)
!NetSurf/!Run$(RUNEXT): riscos/scripts/Run $(EXETARGET) !NetSurf/!Run$(RUNEXT): riscos/scripts/Run $(EXETARGET)
@ -125,6 +119,33 @@ split-messages:
$(call split_install_messages, ro, !NetSurf/Resources/) $(call split_install_messages, ro, !NetSurf/Resources/)
.PHONY: split-messages .PHONY: split-messages
# ----------------------------------------------------------------------------
# Template targets
# ----------------------------------------------------------------------------
# Template objects
TPL_RISCOS := de en fr nl # TODO: It'd be nice to auto-detect these
TPL_RISCOS := $(addprefix riscos/templates/,$(TPL_RISCOS))
define compile_template
!NetSurf/Resources/$(1)/Templates$$(TPLEXT): $(2)
$$(VQ)echo "TEMPLATE: $(2)"
$$(Q)mkdir -p !NetSurf/Resources/$(1)
$$(Q)$$(CC) -x c -E -P $$(CFLAGS) $(2) | $$(CCRES) - $$@
CLEAN_TEMPLATES += !NetSurf/Resources/$(1)/Templates$$(TPLEXT)
endef
$(eval $(foreach TPL,$(TPL_RISCOS), \
$(call compile_template,$(notdir $(TPL)),$(TPL))))
clean-templates:
$(VQ)echo " CLEAN: $(CLEAN_TEMPLATES)"
$(Q)$(RM) $(CLEAN_TEMPLATES)
CLEANS += clean-templates
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Install target # Install target
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------