r5275 jmb - in /trunk/hubbub: Makefile-ronative build/Makefile.common src/Makefile test/Makefile

netsurf at semichrome.net netsurf at semichrome.net
Sun Sep 7 17:41:49 BST 2008


Author: jmb
Date: Sun Sep  7 11:41:49 2008
New Revision: 5275

URL: http://source.netsurf-browser.org?rev=5275&view=rev
Log:
Native RO buildsystem. Beware of the NOP.

Added:
    trunk/hubbub/Makefile-ronative
Modified:
    trunk/hubbub/build/Makefile.common
    trunk/hubbub/src/Makefile
    trunk/hubbub/test/Makefile

Added: trunk/hubbub/Makefile-ronative
URL: http://source.netsurf-browser.org/trunk/hubbub/Makefile-ronative?rev=5275&view=auto
==============================================================================
--- trunk/hubbub/Makefile-ronative (added)
+++ trunk/hubbub/Makefile-ronative Sun Sep  7 11:41:49 2008
@@ -1,0 +1,57 @@
+# Toolchain definitions for building on RISC OS
+GCCSDK_INSTALL_ENV ?= <NSLibs$$Dir>
+
+CC := gcc
+AR := ar
+LD := gcc
+
+CP := cp
+RM := rm
+MKDIR := mkdir
+MV := mv
+ECHO := echo
+MAKE := make
+PERL := perl
+# As good a way of doing nothing as we get, really (FX 1 == set user flag, X ignores errors)
+PKGCONFIG := X FX 1
+INSTALL := echo
+SED := sed
+TOUCH := touch
+LCOV := echo
+GENHTML := echo
+
+# Toolchain flags
+WARNFLAGS := -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align \
+	-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
+	-Wmissing-declarations -Wnested-externs -Werror -pedantic
+CFLAGS = -std=c99 -D_BSD_SOURCE -I$(TOP)/include/ $(WARNFLAGS) \
+	-mpoke-function-name -I$(GCCSDK_INSTALL_ENV)/include
+RELEASECFLAGS = $(CFLAGS) -DNDEBUG -O2
+DEBUGCFLAGS = $(CFLAGS) -O0 -g
+ARFLAGS := -cru
+LDFLAGS = -L$(GCCSDK_INSTALL_ENV)/libs -L$(TOP)/
+
+CPFLAGS :=
+RMFLAGS := -f
+MKDIRFLAGS := -p
+MVFLAGS := 
+ECHOFLAGS := 
+MAKEFLAGS :=
+PKGCONFIGFLAGS :=
+TOUCHFLAGS :=
+
+EXEEXT :=
+
+# Default installation prefix
+PREFIX ?= $(GCCSDK_INSTALL_ENV)
+
+# This is nasty, but needed because $(CURDIR) will 
+# contain colons, and thus confuse make mightily
+$(shell SetMacro Alias$$Hubbubpwd Set %0 <FileSwitch$$CurrentFilingSystem>:|<FileSwitch$$<FileSwitch$$CurrentFilingSystem>$$CSD>|mUnset Alias$$Hubbubpwd)
+$(shell Hubbubpwd Hubbub$$Dir)
+TOP := <Hubbub$$Dir>
+
+# Tell everyone that we're building on RISC OS, so they can work around things.
+HOST := riscos
+
+include build/Makefile.common

Modified: trunk/hubbub/build/Makefile.common
URL: http://source.netsurf-browser.org/trunk/hubbub/build/Makefile.common?rev=5275&r1=5274&r2=5275&view=diff
==============================================================================
--- trunk/hubbub/build/Makefile.common (original)
+++ trunk/hubbub/build/Makefile.common Sun Sep  7 11:41:49 2008
@@ -7,8 +7,8 @@
 COMPONENT := libhubbub
 
 # Environment
-EXPORT := $(CURDIR)/dist
-TOP := $(CURDIR)
+TOP ?= $(CURDIR)
+EXPORT := $(TOP)/dist
 RELEASEDIR := build/Release
 DEBUGDIR := build/Debug
 COVERAGEDIR := build/coverage

Modified: trunk/hubbub/src/Makefile
URL: http://source.netsurf-browser.org/trunk/hubbub/src/Makefile?rev=5275&r1=5274&r2=5275&view=diff
==============================================================================
--- trunk/hubbub/src/Makefile (original)
+++ trunk/hubbub/src/Makefile Sun Sep  7 11:41:49 2008
@@ -32,8 +32,8 @@
 d              := $(DIR)
 
 # Manipulate include paths
-CFLAGS := $(CFLAGS) -I$(d) `$(PKGCONFIG) libparserutils --cflags`
-LDFLAGS := $(LDFLAGS) `$(PKGCONFIG) libparserutils --libs`
+CFLAGS := $(CFLAGS) -I$(d) $(shell $(PKGCONFIG) libparserutils --cflags)
+LDFLAGS := $(LDFLAGS) $(shell $(PKGCONFIG) libparserutils --libs)
 
 # Sources
 SRCS_$(d) := hubbub.c parser.c

Modified: trunk/hubbub/test/Makefile
URL: http://source.netsurf-browser.org/trunk/hubbub/test/Makefile?rev=5275&r1=5274&r2=5275&view=diff
==============================================================================
--- trunk/hubbub/test/Makefile (original)
+++ trunk/hubbub/test/Makefile Sun Sep  7 11:41:49 2008
@@ -34,9 +34,9 @@
 # Extend toolchain settings
 # We require the presence of libjson -- http://oss.metaparadigm.com/json-c/
 CFLAGS := $(CFLAGS) -I$(TOP)/src/ -I$(d) \
-		`$(PKGCONFIG) $(PKGCONFIGFLAGS) --cflags json` \
+		$(shell $(PKGCONFIG) $(PKGCONFIGFLAGS) --cflags json) \
 		-Wno-unused-parameter
-LDFLAGS := $(LDFLAGS) `$(PKGCONFIG) $(PKGCONFIGFLAGS) --libs json`
+LDFLAGS := $(LDFLAGS) $(shell $(PKGCONFIG) $(PKGCONFIGFLAGS) --libs json)
 
 ifdef PROFILE
 	CFLAGS := $(CFLAGS) -pg -fno-omit-frame-pointer
@@ -78,8 +78,14 @@
 endef
 
 # Build rules for each test binary -- they all depend on the debug library
+# Except when building on RISC OS, of course because then make utterly fails to
+# detect that the debug library exists.
 define compile_test
+ifeq ($(HOST),riscos)
+$(2): $(3)
+else
 $(2): $(3) $(TOP)/$(COMPONENT)-debug.a
+endif
 	@$$(ECHO) $$(ECHOFLAGS) "==> $(1)"
 	@$$(CC) -c -g $$(DEBUGCFLAGS) -o $$@.o $(1)
 	@$$(LD) -g -o $$@ $$@.o -lhubbub-debug $$(LDFLAGS) -lgcov




More information about the netsurf-commits mailing list