From 45f3ba0a0bb0d15756d382024110dc8427c709d8 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 28 May 2009 12:39:20 +0000 Subject: Hack in support for native build with GCC. svn path=/trunk/rufl/; revision=7599 --- makefile | 29 ++++++++++++++++++++++++----- 1 file 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 ?= + 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 \ -- cgit v1.2.3