summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2009-05-28 12:39:20 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2009-05-28 12:39:20 (GMT)
commit45f3ba0a0bb0d15756d382024110dc8427c709d8 (patch)
tree9f6bb16b53a3ec0d5c3c5593c8d7a2b4f699791f
parentf2eee7756bea52ffa370b4b0bc07cf6511a52a4b (diff)
downloadlibrufl-45f3ba0a0bb0d15756d382024110dc8427c709d8.tar.gz
librufl-45f3ba0a0bb0d15756d382024110dc8427c709d8.tar.bz2
Hack in support for native build with GCC.
svn path=/trunk/rufl/; revision=7599
-rw-r--r--makefile29
1 files changed, 24 insertions, 5 deletions
diff --git a/makefile b/makefile
index 0b3ed87..b5d7d24 100644
--- a/makefile
+++ b/makefile
@@ -19,11 +19,30 @@ HDRS = rufl.h rufl_internal.h
.PHONY: all install clean
ifeq ($(COMPILER), gcc)
-# cross-compiling using GCCSDK
-GCCSDK_INSTALL_CROSSBIN ?= /home/riscos/cross/bin
-GCCSDK_INSTALL_ENV ?= /home/riscos/env
-CC := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*gcc)
-AR := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*ar)
+# cross-compiling using GCCSDK or native build with GCC
+
+HOST := $(shell uname -s)
+ifeq ($(HOST),)
+ HOST := riscos
+ $(warning Build platform determination failed but that's a known problem for RISC OS so we're assuming a native RISC OS build.)
+else
+ ifeq ($(HOST),RISC OS)
+ # Fixup uname -s returning "RISC OS"
+ HOST := riscos
+ endif
+endif
+
+ifeq ($(HOST),riscos)
+ GCCSDK_INSTALL_ENV ?= <NSLibs$$Dir>
+ CC := gcc
+ AR := ar
+else
+ GCCSDK_INSTALL_CROSSBIN ?= /home/riscos/cross/bin
+ GCCSDK_INSTALL_ENV ?= /home/riscos/env
+ CC := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*gcc)
+ AR := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*ar)
+endif
+
CFLAGS = -std=c99 -O3 -W -Wall -Wundef -Wpointer-arith -Wcast-qual \
-Wcast-align -Wwrite-strings -Wstrict-prototypes \
-Wmissing-prototypes -Wmissing-declarations \