From e6909120d67d86cd3a3fd9518f1d0be2f2f5a523 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Wed, 2 Jun 2004 21:40:55 +0000 Subject: [project @ 2004-06-02 21:40:55 by bursa] Add some comments and targets and clean up. svn path=/import/netsurf/; revision=924 --- makefile | 164 +++++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 103 insertions(+), 61 deletions(-) (limited to 'makefile') diff --git a/makefile b/makefile index 696164e53..86377717b 100644 --- a/makefile +++ b/makefile @@ -4,50 +4,68 @@ # http://www.opensource.org/licenses/gpl-license # -# The 'all' target is presented first so as not to screw up over targets included -# in the platform specific files - -all: !NetSurf/!RunImage,ff8 $(DOCS) - -OBJECTS_COMMON = cache.o content.o fetch.o fetchcache.o \ - css.o css_enum.o parser.o ruleset.o scanner.o \ - box.o form.o html.o layout.o textplain.o \ - messages.o utils.o translit.o pool.o url.o imagemap.o \ - jpeg.o save_complete.o loginlist.o gif.o gifread.o -OBJECTS = $(OBJECTS_COMMON) \ - browser.o netsurf.o options.o \ - htmlinstance.o htmlredraw.o \ - 401login.o constdata.o dialog.o download.o frames.o wimp.o gui.o \ - menus.o mouseactions.o \ - textselection.o toolbar.o theme.o window.o \ - draw.o plugin.o png.o sprite.o \ - about.o filetype.o font.o uri.o url_protocol.o history.o \ - version.o thumbnail.o \ - save.o save_draw.o save_text.o schedule.o help.o - -OBJECTS_DEBUG = $(OBJECTS_COMMON) \ - netsurfd.o \ - options.o filetyped.o fontd.o -OBJECTS_DEBUGRO = $(OBJECTS_COMMON) \ - netsurfd.o \ - constdata.o \ - theme.o \ - draw.o gif.o png.o sprite.o \ - about.o filetype.o \ - version.o \ - options.o font.o schedule.o - -OBJDIR = $(shell $(CC) -dumpmachine) -SOURCES=$(OBJECTS:.o=.c) -OBJS=$(OBJECTS:%.o=$(OBJDIR)/%.o) +# There are 5 possible builds of NetSurf: +# +# riscos -- standard RISC OS build +# riscos_small -- identical to "riscos", but linked with smaller libraries +# (no openssl, and libcurl without ssl support) +# debug -- command line Unix/Linux, for debugging +# riscos_debug -- a cross between "riscos" and "debug" +# gtk -- experimental gtk version +# +# "riscos", "riscos_small", and "riscos_debug" can be compiled under RISC OS, +# or cross-compiled using gccsdk. + +OBJECTS_COMMON = cache.o content.o fetch.o fetchcache.o # content/ +OBJECTS_COMMON += css.o css_enum.o parser.o ruleset.o scanner.o # css/ +OBJECTS_COMMON += box.o form.o html.o layout.o textplain.o # render/ +OBJECTS_COMMON += messages.o pool.o translit.o url.o utils.o # utils/ +OBJECTS_COMMON += imagemap.o loginlist.o options.o # desktop/ + +OBJECTS_RISCOS = $(OBJECTS_COMMON) +OBJECTS_RISCOS += browser.o netsurf.o version.o # desktop/ +OBJECTS_RISCOS += 401login.o about.o constdata.o dialog.o download.o \ + draw.o filetype.o font.o gif.o gifread.o gui.o help.o \ + history.o htmlinstance.o htmlredraw.o jpeg.o menus.o \ + mouseactions.o plugin.o png.o save.o save_complete.o \ + save_draw.o save_text.o schedule.o sprite.o \ + textselection.o theme.o thumbnail.o toolbar.o uri.o \ + url_protocol.o wimp.o window.o # riscos/ + +OBJECTS_DEBUG = $(OBJECTS_COMMON) +OBJECTS_DEBUG += filetyped.o fontd.o netsurfd.o # debug/ +OBJECTS_DEBUG += gif.o gifread.o jpeg.o png.o save_complete.o schedule.o \ + save_draw.o # riscos/ + +OBJECTS_DEBUGRO = $(OBJECTS_COMMON) +OBJECTS_DEBUGRO += netsurfd.o # debug/ +OBJECTS_DEBUGRO += version.o # desktop/ +OBJECTS_DEBUGRO += about.o constdata.o draw.o filetype.o font.o \ + gif.o gifread.o jpeg.o png.o save_complete.o schedule.o \ + sprite.o theme.o toolbar.o wimp.o # riscos/ + +OBJECTS_GTK = $(OBJECTS_COMMON) +OBJECTS_GTK += filetyped.o # debug/ +OBJECTS_GTK += browser.o netsurf.o # desktop/ +OBJECTS_GTK += font_pango.o gtk_gui.o # gtk/ + + +OBJDIR_RISCOS = $(shell $(CC) -dumpmachine) +SOURCES_RISCOS=$(OBJECTS_RISCOS:.o=.c) +OBJS_RISCOS=$(OBJECTS_RISCOS:%.o=$(OBJDIR_RISCOS)/%.o) OBJDIR_DEBUG = $(shell $(CC_DEBUG) -dumpmachine)-debug SOURCES_DEBUG=$(OBJECTS_DEBUG:.o=.c) OBJS_DEBUG=$(OBJECTS_DEBUG:%.o=$(OBJDIR_DEBUG)/%.o) -OBJS_DEBUGRO=$(OBJECTS_DEBUGRO:%.o=$(OBJDIR_DEBUG)/%.o) -# Inclusion of platform specific files has to occur after the OBJDIR stuff as that -# is refered to in the files +OBJS_DEBUGRO=$(OBJECTS_DEBUGRO:%.o=$(OBJDIR_RISCOS)/%.o) + +OBJDIR_GTK = $(shell gcc -dumpmachine)-gtk +SOURCES_GTK=$(OBJECTS_GTK:.o=.c) +OBJS_GTK=$(OBJECTS_GTK:%.o=$(OBJDIR_GTK)/%.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 $(CC) -dumpmachine))) ifeq ($(OS),riscos) @@ -56,7 +74,7 @@ else include posix.mk endif -VPATH = content:css:desktop:render:riscos:utils:debug +VPATH = content:css:desktop:render:riscos:utils:debug:gtk WARNFLAGS = -W -Wall -Wundef -Wpointer-arith -Wbad-function-cast -Wcast-qual \ -Wcast-align -Wwrite-strings -Wstrict-prototypes \ @@ -64,31 +82,50 @@ WARNFLAGS = -W -Wall -Wundef -Wpointer-arith -Wbad-function-cast -Wcast-qual \ -Wnested-externs -Winline -Wno-unused-parameter -Wuninitialized # CFLAGS have to appear after the inclusion of platform specific files as the -# PLTFORM_CFLAGS variables are defined in them +# PLATFORM_CFLAGS variables are defined in them -CFLAGS = -std=c9x -D_BSD_SOURCE -Driscos -DBOOL_DEFINED -O $(WARNFLAGS) -I.. \ - $(PLATFORM_CFLAGS) -mpoke-function-name -CFLAGS_DEBUG = -std=c9x -D_BSD_SOURCE $(WARNFLAGS) -I.. $(PLATFORM_CFLAGS_DEBUG) -g +CFLAGS_RISCOS = -std=c9x -D_BSD_SOURCE -Driscos -DBOOL_DEFINED -O \ + $(WARNFLAGS) -I.. $(PLATFORM_CFLAGS) -mpoke-function-name +CFLAGS_DEBUG = -std=c9x -D_BSD_SOURCE -Ddebug $(WARNFLAGS) -I.. \ + $(PLATFORM_CFLAGS_DEBUG) -g +CFLAGS_GTK = -std=c9x -D_BSD_SOURCE -D_POSIX_C_SOURCE -Dgtk \ + $(WARNFLAGS) -I.. -g \ + `pkg-config --cflags gtk+-2.0` `xml2-config --cflags` # targets -u!RunImage,ff8 : $(OBJS) +riscos: $(RUNIMAGE) +$(RUNIMAGE) : $(OBJS_RISCOS) + $(CC) -o $@ $(LDFLAGS_RISCOS) $^ +riscos_small: u!RunImage,ff8 +u!RunImage,ff8 : $(OBJS_RISCOS) $(CC) -o $@ $(LDFLAGS_SMALL) $^ -netsurf.zip: !NetSurf/!RunImage,ff8 $(DOCS) - rm netsurf.zip; riscos-zip -9vr, netsurf.zip !NetSurf -# debug targets -debug: netsurf -netsurf: $(OBJS_DEBUG) - $(CC_DEBUG) -o $@ $(LDFLAGS_DEBUG) $^ -debugro: nsdebug,ff8 -nsdebug,ff8: $(OBJS_DEBUGRO) +debug: nsdebug +nsdebug: $(OBJS_DEBUG) $(CC_DEBUG) -o $@ $(LDFLAGS_DEBUG) $^ +riscos_debug: nsrodebug,ff8 +nsrodebug,ff8: $(OBJS_DEBUGRO) + $(CC) -o $@ $(LDFLAGS_RISCOS) $^ + +gtk: nsgtk +nsgtk: $(OBJS_GTK) + gcc -o nsgtk `pkg-config --cflags --libs gtk+-2.0 gthread-2.0` \ + $(LDFLAGS_DEBUG) $^ + +netsurf.zip: $(RUNIMAGE) + rm netsurf.zip; riscos-zip -9vr, netsurf.zip !NetSurf + # pattern rule for c source -$(OBJDIR)/%.o : %.c - $(CC) -o $@ -c $(CFLAGS) $< +$(OBJDIR_RISCOS)/%.o : %.c + @echo "==> $<" + @$(CC) -o $@ -c $(CFLAGS_RISCOS) $< $(OBJDIR_DEBUG)/%.o : %.c - $(CC_DEBUG) -o $@ -c $(CFLAGS_DEBUG) $< + @echo "==> $<" + @$(CC_DEBUG) -o $@ -c $(CFLAGS_DEBUG) $< +$(OBJDIR_GTK)/%.o : %.c + @echo "==> $<" + @gcc -o $@ -c $(CFLAGS_GTK) $< # special cases css/css_enum.c css/css_enum.h: css/css_enums css/makeenum @@ -101,12 +138,17 @@ utils/translit.c: transtab cd utils; ./tt2code < transtab > translit.c # generate dependencies -depend : $(SOURCES) $(SOURCES_DEBUG) - -mkdir $(OBJDIR) $(OBJDIR_DEBUG) - $(CC) -MM -MG $(CFLAGS) $^ | sed 's|.*\.o:|$(OBJDIR)/&|g' > $@ - $(CC_DEBUG) -MM -MG $(CFLAGS_DEBUG) $^ | sed 's|.*\.o:|$(OBJDIR_DEBUG)/&|g' >> $@ +depend : $(SOURCES_RISCOS) $(SOURCES_DEBUG) $(SOURCES_GTK) + -mkdir $(OBJDIR_RISCOS) $(OBJDIR_DEBUG) $(OBJDIR_GTK) + $(CC) -MM -MG $(CFLAGS_RISCOS) $^ | sed 's|.*\.o:|$(OBJDIR_RISCOS)/&|g' > depend + $(CC_DEBUG) -MM -MG $(CFLAGS_DEBUG) $^ | sed 's|.*\.o:|$(OBJDIR_DEBUG)/&|g' >> depend # remove generated files clean : - -rm $(OBJDIR)/* $(OBJDIR_DEBUG)/* depend css/css_enum.c css/css_enum.h \ + -rm $(OBJDIR_RISCOS)/* $(OBJDIR_DEBUG)/* $(OBJDIR_GTK)/* \ + depend css/css_enum.c css/css_enum.h \ css/parser.c css/parser.h css/scanner.c css/scanner.h + +ifneq ($(OS),riscos) +include depend +endif -- cgit v1.2.3