summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2008-09-07 13:32:01 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2008-09-07 13:32:01 +0000
commit8b0c4f84fe51a4ec652fe410c3f20ea8a0d3aea8 (patch)
treeaadff71725bdbdc6999be4bb5323986f0c96f675
parentf1cab3aed419f78d15acdc831ec7900ddfe6384a (diff)
downloadlibparserutils-8b0c4f84fe51a4ec652fe410c3f20ea8a0d3aea8.tar.gz
libparserutils-8b0c4f84fe51a4ec652fe410c3f20ea8a0d3aea8.tar.bz2
Native RO makefile. Don't expect anything other than make/make debug to actually work thanks to insane amounts of buggy behaviour in the OS/runtime that I can't find the energy to work around.
svn path=/trunk/libparserutils/; revision=5270
-rw-r--r--Makefile-ronative56
-rw-r--r--build/Makefile.common4
-rw-r--r--test/Makefile6
3 files changed, 64 insertions, 2 deletions
diff --git a/Makefile-ronative b/Makefile-ronative
new file mode 100644
index 0000000..c469e0d
--- /dev/null
+++ b/Makefile-ronative
@@ -0,0 +1,56 @@
+# 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
+PKGCONFIG := echo
+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
+RELEASECFLAGS = $(CFLAGS) -DNDEBUG -O2
+DEBUGCFLAGS = $(CFLAGS) -O0 -g
+ARFLAGS := -cru
+LDFLAGS = -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$$LPUpwd Set %0 <FileSwitch$$CurrentFilingSystem>:|<FileSwitch$$<FileSwitch$$CurrentFilingSystem>$$CSD>|mUnset Alias$$LPUpwd)
+$(shell LPUpwd LibParserUtils$$Dir)
+TOP := <LibParserUtils$$Dir>
+
+# Tell everyone that we're building on RISC OS, so they can work around things.
+HOST := riscos
+
+include build/Makefile.common
diff --git a/build/Makefile.common b/build/Makefile.common
index d66237e..c0f492b 100644
--- a/build/Makefile.common
+++ b/build/Makefile.common
@@ -7,8 +7,8 @@ all: release
COMPONENT := libparserutils
# Environment
-EXPORT := $(CURDIR)/dist
-TOP := $(CURDIR)
+TOP ?= $(CURDIR)
+EXPORT := $(TOP)/dist
RELEASEDIR := build/Release
DEBUGDIR := build/Debug
COVERAGEDIR := build/coverage
diff --git a/test/Makefile b/test/Makefile
index 8d5bc82..fecfca4 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -71,8 +71,14 @@ $(2): $(1)
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): $(1)
+else
$(2): $$(TOP)/$$(COMPONENT)-debug.a $(1)
+endif
@$$(ECHO) $$(ECHOFLAGS) "==> $(1)"
@$$(CC) -c -g $$(DEBUGCFLAGS) -o $$@.o $(1)
@$$(LD) -g -o $$@ $$@.o $$(LDFLAGS) -lparserutils-debug