diff options
author | Richard Wilson <rjw@netsurf-browser.org> | 2004-11-07 19:19:11 +0000 |
---|---|---|
committer | Richard Wilson <rjw@netsurf-browser.org> | 2004-11-07 19:19:11 +0000 |
commit | 5e41fb8a121c441a8765a1962a892e93906cde83 (patch) | |
tree | 0fd0a6aa6adbd7275b7a2fd9216d1e063a968ad0 /makefile | |
download | nstheme-5e41fb8a121c441a8765a1962a892e93906cde83.tar.gz nstheme-5e41fb8a121c441a8765a1962a892e93906cde83.tar.bz2 |
[project @ 2004-11-07 19:19:11 by rjw]
Initial import.
svn path=/import/nstheme/; revision=2436
Diffstat (limited to 'makefile')
-rw-r--r-- | makefile | 71 |
1 files changed, 71 insertions, 0 deletions
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 |