From 5e41fb8a121c441a8765a1962a892e93906cde83 Mon Sep 17 00:00:00 2001 From: Richard Wilson Date: Sun, 7 Nov 2004 19:19:11 +0000 Subject: [project @ 2004-11-07 19:19:11 by rjw] Initial import. svn path=/import/nstheme/; revision=2436 --- makefile | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 makefile (limited to 'makefile') diff --git a/makefile b/makefile new file mode 100644 index 0000000..71bb865 --- /dev/null +++ b/makefile @@ -0,0 +1,71 @@ +# +# This file is part of NetSurf, http://netsurf.sourceforge.net/ +# Licensed under the GNU General Public License, +# http://www.opensource.org/licenses/gpl-license +# + +# There is 1 possible build of NSTheme: +# +# riscos -- standard RISC OS build +# +# "riscos" can be compiled under RISC OS, or cross-compiled using gccsdk. + +OBJECTS_COMMON = messages.o utils.o # utils/ +OBJECTS_COMMON += nstheme.o options.o # desktop/ + +OBJECTS_RISCOS = $(OBJECTS_COMMON) +OBJECTS_RISCOS += dialog.o gui.o help.o menus.o wimp.o save.o + + +OBJDIR_RISCOS = $(shell $(CC) -dumpmachine) +SOURCES_RISCOS=$(OBJECTS_RISCOS:.o=.c) +OBJS_RISCOS=$(OBJECTS_RISCOS:%.o=$(OBJDIR_RISCOS)/%.o) + +# Inclusion of platform specific files has to occur after the OBJDIR stuff as +# that is refered to in the files + +OS = $(word 2,$(subst -, ,$(shell gcc -dumpmachine))) +ifeq ($(OS),riscos) +include riscos.mk +else +include posix.mk +endif + +VPATH = desktop:riscos:utils + +WARNFLAGS = -W -Wall -Wundef -Wpointer-arith -Wcast-qual \ + -Wcast-align -Wwrite-strings -Wstrict-prototypes \ + -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls \ + -Wnested-externs -Winline -Wno-unused-parameter -Wuninitialized + +# CFLAGS have to appear after the inclusion of platform specific files as the +# PLATFORM_CFLAGS variables are defined in them + +CFLAGS_RISCOS = -std=c9x -D_BSD_SOURCE -Driscos -DBOOL_DEFINED -O2 \ + $(WARNFLAGS) -I.. $(PLATFORM_CFLAGS_RISCOS) -mpoke-function-name \ + +# targets +riscos: $(RUNIMAGE) +$(RUNIMAGE) : $(OBJS_RISCOS) + $(CC) -o $@ $(LDFLAGS_RISCOS) $^ + +netsurf.zip: $(RUNIMAGE) + rm nstheme.zip; riscos-zip -9vr, nstheme.zip !NSTheme + +# pattern rule for c source +$(OBJDIR_RISCOS)/%.o : %.c + @echo "==> $<" + @$(CC) -o $@ -c $(CFLAGS_RISCOS) $< + +# generate dependencies +depend : $(SOURCES_RISCOS) + -mkdir $(OBJDIR_RISCOS) + $(CC) -MM -MG $(CFLAGS_RISCOS) $^ | sed 's|.*\.o:|$(OBJDIR_RISCOS)/&|g' > depend + +# remove generated files +clean : + -rm $(OBJDIR_RISCOS) + +ifneq ($(OS),riscos) +include depend +endif -- cgit v1.2.3