diff --git a/Makefile b/Makefile index 1af792ade..618374581 100644 --- a/Makefile +++ b/Makefile @@ -637,6 +637,12 @@ POSTEXES := include frontends/Makefile +# ---------------------------------------------------------------------------- +# Build tools setup +# ---------------------------------------------------------------------------- + +include tools/Makefile + # ---------------------------------------------------------------------------- # General source file setup # ---------------------------------------------------------------------------- @@ -743,10 +749,6 @@ clean-target: $(Q)$(RM) $(EXETARGET) CLEANS += clean-target -clean-testament: - $(VQ)echo " CLEAN: testament.h" - $(Q)$(RM) $(OBJROOT)/testament.h -CLEANS += clean-testament clean-builddir: $(VQ)echo " CLEAN: $(OBJROOT)" @@ -754,10 +756,7 @@ clean-builddir: CLEANS += clean-builddir -.PHONY: all-program testament - -testament $(OBJROOT)/testament.h: - $(Q)$(PERL) utils/git-testament.pl $(CURDIR) $(OBJROOT)/testament.h +.PHONY: all-program all-program: $(EXETARGET) $(POSTEXES) diff --git a/frontends/riscos/Makefile b/frontends/riscos/Makefile index c028ed789..af6585c46 100644 --- a/frontends/riscos/Makefile +++ b/frontends/riscos/Makefile @@ -178,7 +178,7 @@ netsurf.zip: $(EXETARGET) $(eval $@_TMPDIR := $(shell mktemp -d)) $(Q) $(RM) $@ $(Q) cp -rLvp $(FRONTEND_SOURCE_DIR)/appdir $($@_TMPDIR)/!NetSurf - $(Q) $(CURDIR)/utils/git-date.sh $(FRONTEND_SOURCE_DIR)/distribution + $(Q) $(CURDIR)/tools/git-date.sh $(FRONTEND_SOURCE_DIR)/distribution $(Q) rsync --archive --verbose $(FRONTEND_SOURCE_DIR)/distribution/!Boot $($@_TMPDIR) $(Q) rsync --archive --verbose $(FRONTEND_SOURCE_DIR)/distribution/!System $($@_TMPDIR) $(Q) rsync --archive --verbose $(FRONTEND_SOURCE_DIR)/distribution/3rdParty $($@_TMPDIR) diff --git a/utils/DerivedJoiningType.txt b/tools/DerivedJoiningType.txt similarity index 100% rename from utils/DerivedJoiningType.txt rename to tools/DerivedJoiningType.txt diff --git a/tools/Makefile b/tools/Makefile new file mode 100644 index 000000000..5dc4a1000 --- /dev/null +++ b/tools/Makefile @@ -0,0 +1,75 @@ +# Tools + +# testament rules + +clean-testament: + $(VQ)echo " CLEAN: testament.h" + $(Q)$(RM) $(OBJROOT)/testament.h +CLEANS += clean-testament + +.PHONY: testament + +testament $(OBJROOT)/testament.h: + $(Q)$(PERL) tools/git-testament.pl $(CURDIR) $(OBJROOT)/testament.h + + +# lib png build compiler flags +ifeq ($(HOST),OpenBSD) + BUILD_LIBPNG_CFLAGS += $(shell $(PKG_CONFIG) --cflags libpng) + BUILD_LIBPNG_LDFLAGS += $(shell $(PKG_CONFIG) --libs libpng) +else + ifeq ($(HOST),FreeBSD) + BUILD_LIBPNG_CFLAGS += $(shell $(PKG_CONFIG) --cflags libpng) + BUILD_LIBPNG_LDFLAGS += $(shell $(PKG_CONFIG) --libs libpng) + else + BUILD_LIBPNG_CFLAGS += + BUILD_LIBPNG_LDFLAGS += -lpng + endif +endif + + +# Build tool to convert file to comiled data +# +$(TOOLROOT)/xxd: tools/xxd.c $(TOOLROOT)/created + $(VQ)echo "BUILD CC: $@" + $(Q)$(BUILD_CC) $(BUILD_CFLAGS) -o $@ $< $(BUILD_LDFLAGS) + + +# Build tool to filter messages +# +$(TOOLROOT)/split-messages: tools/split-messages.c $(TOOLROOT)/created + $(VQ)echo "BUILD CC: $@" + $(Q)$(BUILD_CC) $(BUILD_CFLAGS) -I. -o $@ $< $(BUILD_LDFLAGS) -lz + + +# Build tool to convert image bitmaps to source code. +# +$(TOOLROOT)/convert_image: tools/convert_image.c $(TOOLROOT)/created + $(VQ)echo "BUILD CC: $@" + $(Q)$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LIBPNG_CFLAGS) -o $@ $< $(BUILD_LDFLAGS) $(BUILD_LIBPNG_LDFLAGS) + + +# Build too to perform font conversion +$(TOOLROOT)/convert_font: tools/convert_font.c $(TOOLROOT)/created + $(VQ)echo "BUILD CC: $@" + $(Q)$(BUILD_CC) $(BUILD_CFLAGS) -o $@ $< + +# idna +# +IDNA_UNICODE_MAJOR=11 + +tools/DerivedJoiningType.txt: + curl -o $@ "https://www.unicode.org/Public/$(IDNA_UNICODE_MAJOR).0.0/ucd/extracted/DerivedJoiningType.txt" + +tools/IdnaMappingTable.txt: + curl -o $@ "https://www.unicode.org/Public/idna/$(IDNA_UNICODE_MAJOR).0.0/IdnaMappingTable.txt" + +tools/idna-tables-properties.csv: + curl -o $@ "https://www.iana.org/assignments/idna-tables-$(IDNA_UNICODE_MAJOR).0.0/idna-tables-properties.csv" + +# the idna props header must be explicitly rebuilt +ifneq ($(filter $(MAKECMDGOALS),utils/idna_props.h),) +utils/idna_props.h: tools/DerivedJoiningType.txt tools/idna-tables-properties.csv + $(VQ)echo " IDNA: $@" + $(Q)$(PERL) tools/idna-derived-props-gen.pl -o $@ -p tools/idna-tables-properties.csv -j tools/DerivedJoiningType.txt +endif diff --git a/utils/convert_font.c b/tools/convert_font.c similarity index 100% rename from utils/convert_font.c rename to tools/convert_font.c diff --git a/utils/convert_image.c b/tools/convert_image.c similarity index 100% rename from utils/convert_image.c rename to tools/convert_image.c diff --git a/utils/coverity-build.sh b/tools/coverity-build.sh similarity index 100% rename from utils/coverity-build.sh rename to tools/coverity-build.sh diff --git a/utils/fetch-transifex.pl b/tools/fetch-transifex.pl similarity index 100% rename from utils/fetch-transifex.pl rename to tools/fetch-transifex.pl diff --git a/utils/git-date.sh b/tools/git-date.sh similarity index 100% rename from utils/git-date.sh rename to tools/git-date.sh diff --git a/utils/git-testament.pl b/tools/git-testament.pl similarity index 100% rename from utils/git-testament.pl rename to tools/git-testament.pl diff --git a/utils/idna-derived-props-gen.pl b/tools/idna-derived-props-gen.pl similarity index 100% rename from utils/idna-derived-props-gen.pl rename to tools/idna-derived-props-gen.pl diff --git a/utils/idna-tables-properties.csv b/tools/idna-tables-properties.csv similarity index 100% rename from utils/idna-tables-properties.csv rename to tools/idna-tables-properties.csv diff --git a/utils/import-messages.pl b/tools/import-messages.pl similarity index 100% rename from utils/import-messages.pl rename to tools/import-messages.pl diff --git a/utils/jenkins-build.sh b/tools/jenkins-build.sh similarity index 100% rename from utils/jenkins-build.sh rename to tools/jenkins-build.sh diff --git a/utils/memanalyze.pl b/tools/memanalyze.pl similarity index 100% rename from utils/memanalyze.pl rename to tools/memanalyze.pl diff --git a/utils/split-messages.c b/tools/split-messages.c similarity index 99% rename from utils/split-messages.c rename to tools/split-messages.c index 581151485..0bce7397f 100644 --- a/utils/split-messages.c +++ b/tools/split-messages.c @@ -11,7 +11,7 @@ #include #include -#include "errors.h" +#include "utils/errors.h" enum out_fmt { OUTPUTFMT_NONE = 0, diff --git a/utils/split-messages.pl b/tools/split-messages.pl similarity index 100% rename from utils/split-messages.pl rename to tools/split-messages.pl diff --git a/utils/test-netsurf b/tools/test-netsurf similarity index 100% rename from utils/test-netsurf rename to tools/test-netsurf diff --git a/utils/valgrind.supp b/tools/valgrind.supp similarity index 100% rename from utils/valgrind.supp rename to tools/valgrind.supp diff --git a/utils/xxd.c b/tools/xxd.c similarity index 100% rename from utils/xxd.c rename to tools/xxd.c diff --git a/utils/Makefile b/utils/Makefile index a0b73d72b..b186cd116 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -24,67 +24,3 @@ S_UTILS := \ utils.c S_UTILS := $(addprefix utils/,$(S_UTILS)) - - -# lib png build compiler flags -ifeq ($(HOST),OpenBSD) - BUILD_LIBPNG_CFLAGS += $(shell $(PKG_CONFIG) --cflags libpng) - BUILD_LIBPNG_LDFLAGS += $(shell $(PKG_CONFIG) --libs libpng) -else - ifeq ($(HOST),FreeBSD) - BUILD_LIBPNG_CFLAGS += $(shell $(PKG_CONFIG) --cflags libpng) - BUILD_LIBPNG_LDFLAGS += $(shell $(PKG_CONFIG) --libs libpng) - else - BUILD_LIBPNG_CFLAGS += - BUILD_LIBPNG_LDFLAGS += -lpng - endif -endif - - -# Build tool to convert file to comiled data -# -$(TOOLROOT)/xxd: utils/xxd.c $(TOOLROOT)/created - $(VQ)echo "BUILD CC: $@" - $(Q)$(BUILD_CC) $(BUILD_CFLAGS) -o $@ $< $(BUILD_LDFLAGS) - - -# Build tool to filter messages -# -$(TOOLROOT)/split-messages: utils/split-messages.c $(TOOLROOT)/created - $(VQ)echo "BUILD CC: $@" - $(Q)$(BUILD_CC) $(BUILD_CFLAGS) -o $@ $< $(BUILD_LDFLAGS) -lz - - -# Build tool to convert image bitmaps to source code. -# -$(TOOLROOT)/convert_image: utils/convert_image.c $(TOOLROOT)/created - $(VQ)echo "BUILD CC: $@" - $(Q)$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LIBPNG_CFLAGS) -o $@ $< $(BUILD_LDFLAGS) $(BUILD_LIBPNG_LDFLAGS) - - -# Build too to perform font conversion -# -$(TOOLROOT)/convert_font: utils/convert_font.c $(TOOLROOT)/created - $(VQ)echo "BUILD CC: $@" - $(Q)$(BUILD_CC) $(BUILD_CFLAGS) -o $@ $< - - -# idna -# -IDNA_UNICODE_MAJOR=11 - -utils/DerivedJoiningType.txt: - curl -o $@ "https://www.unicode.org/Public/$(IDNA_UNICODE_MAJOR).0.0/ucd/extracted/DerivedJoiningType.txt" - -utils/IdnaMappingTable.txt: - curl -o $@ "https://www.unicode.org/Public/idna/$(IDNA_UNICODE_MAJOR).0.0/IdnaMappingTable.txt" - -utils/idna-tables-properties.csv: - curl -o $@ "https://www.iana.org/assignments/idna-tables-$(IDNA_UNICODE_MAJOR).0.0/idna-tables-properties.csv" - -# the idna props header must be explicitly rebuilt -ifneq ($(filter $(MAKECMDGOALS),utils/idna_props.h),) -utils/idna_props.h: utils/DerivedJoiningType.txt utils/idna-tables-properties.csv - $(VQ)echo " IDNA: $@" - $(Q)$(PERL) utils/idna-derived-props-gen.pl -o $@ -p utils/idna-tables-properties.csv -j utils/DerivedJoiningType.txt -endif