2003-06-30 16:44:03 +04:00
|
|
|
#
|
|
|
|
# This file is part of NetSurf, http://netsurf.sourceforge.net/
|
|
|
|
# Licensed under the GNU General Public License,
|
|
|
|
# http://www.opensource.org/licenses/gpl-license
|
|
|
|
#
|
2002-07-28 01:10:45 +04:00
|
|
|
|
2004-05-21 00:06:31 +04:00
|
|
|
OS = $(word 2,$(subst -, ,$(shell $(CC) -dumpmachine)))
|
|
|
|
|
|
|
|
ifeq ($(OS),riscos)
|
|
|
|
include riscos.mk
|
|
|
|
else
|
|
|
|
include posix.mk
|
|
|
|
endif
|
|
|
|
|
2004-03-11 05:19:14 +03:00
|
|
|
OBJECTS_COMMON = cache.o content.o fetch.o fetchcache.o \
|
2003-05-31 22:40:46 +04:00
|
|
|
css.o css_enum.o parser.o ruleset.o scanner.o \
|
2003-10-25 04:35:49 +04:00
|
|
|
box.o form.o html.o layout.o textplain.o \
|
2004-03-27 03:54:03 +03:00
|
|
|
messages.o utils.o translit.o pool.o url.o imagemap.o \
|
2004-04-25 03:42:32 +04:00
|
|
|
jpeg.o save_complete.o loginlist.o gif.o gifread.o
|
2003-06-21 17:18:00 +04:00
|
|
|
OBJECTS = $(OBJECTS_COMMON) \
|
2004-04-14 16:54:20 +04:00
|
|
|
browser.o netsurf.o options.o \
|
2004-03-27 03:54:03 +03:00
|
|
|
htmlinstance.o htmlredraw.o \
|
2004-05-05 02:23:44 +04:00
|
|
|
401login.o constdata.o dialog.o download.o frames.o wimp.o gui.o \
|
2003-11-13 01:22:45 +03:00
|
|
|
menus.o mouseactions.o \
|
2004-05-05 02:23:44 +04:00
|
|
|
textselection.o toolbar.o theme.o window.o \
|
2004-04-25 03:42:32 +04:00
|
|
|
draw.o plugin.o png.o sprite.o \
|
2004-03-02 21:02:41 +03:00
|
|
|
about.o filetype.o font.o uri.o url_protocol.o history.o \
|
2004-03-06 15:34:47 +03:00
|
|
|
version.o thumbnail.o \
|
2004-05-12 04:23:11 +04:00
|
|
|
save.o save_draw.o save_text.o schedule.o help.o
|
2004-05-21 00:06:31 +04:00
|
|
|
|
2003-06-21 17:18:00 +04:00
|
|
|
OBJECTS_DEBUG = $(OBJECTS_COMMON) \
|
|
|
|
netsurfd.o \
|
2004-02-13 19:09:12 +03:00
|
|
|
options.o filetyped.o fontd.o
|
2004-01-02 15:01:23 +03:00
|
|
|
OBJECTS_DEBUGRO = $(OBJECTS_COMMON) \
|
|
|
|
netsurfd.o \
|
|
|
|
constdata.o \
|
|
|
|
theme.o \
|
2004-03-27 03:54:03 +03:00
|
|
|
draw.o gif.o png.o sprite.o \
|
2004-01-02 15:01:23 +03:00
|
|
|
about.o filetype.o \
|
|
|
|
version.o \
|
2004-04-14 16:54:20 +04:00
|
|
|
options.o font.o schedule.o
|
2004-05-21 00:06:31 +04:00
|
|
|
|
2003-06-21 17:18:00 +04:00
|
|
|
VPATH = content:css:desktop:render:riscos:utils:debug
|
2004-05-21 00:06:31 +04:00
|
|
|
|
2003-05-31 22:40:46 +04:00
|
|
|
WARNFLAGS = -W -Wall -Wundef -Wpointer-arith -Wbad-function-cast -Wcast-qual \
|
2004-02-26 20:22:41 +03:00
|
|
|
-Wcast-align -Wwrite-strings -Wstrict-prototypes \
|
2003-05-31 22:40:46 +04:00
|
|
|
-Wmissing-prototypes -Wmissing-declarations -Wredundant-decls \
|
2003-07-10 01:33:01 +04:00
|
|
|
-Wnested-externs -Winline -Wno-unused-parameter -Wuninitialized
|
2004-05-21 00:06:31 +04:00
|
|
|
|
2003-10-31 18:18:36 +03:00
|
|
|
CFLAGS = -std=c9x -D_BSD_SOURCE -Driscos -DBOOL_DEFINED -O $(WARNFLAGS) -I.. \
|
2004-05-21 00:06:31 +04:00
|
|
|
$(PLATFORM_CFLAGS) -mpoke-function-name
|
|
|
|
CFLAGS_DEBUG = -std=c9x -D_BSD_SOURCE -Driscos $(WARNFLAGS) -I.. $(PLATFORM_CFLAGS_DEBUG) -g
|
2003-05-31 22:40:46 +04:00
|
|
|
|
|
|
|
OBJDIR = $(shell $(CC) -dumpmachine)
|
|
|
|
SOURCES=$(OBJECTS:.o=.c)
|
|
|
|
OBJS=$(OBJECTS:%.o=$(OBJDIR)/%.o)
|
2004-05-21 00:06:31 +04:00
|
|
|
|
|
|
|
OBJDIR_DEBUG = $(shell $(CC_DEBUG) -dumpmachine)-debug
|
2003-06-21 17:18:00 +04:00
|
|
|
SOURCES_DEBUG=$(OBJECTS_DEBUG:.o=.c)
|
|
|
|
OBJS_DEBUG=$(OBJECTS_DEBUG:%.o=$(OBJDIR_DEBUG)/%.o)
|
2004-05-21 00:06:31 +04:00
|
|
|
OBJS_DEBUGRO=$(OBJECTS_DEBUGRO:%.o=$(OBJDIR_DEBUG)/%.o)
|
2003-05-31 22:40:46 +04:00
|
|
|
|
|
|
|
# targets
|
2003-06-05 18:39:54 +04:00
|
|
|
all: !NetSurf/!RunImage,ff8 $(DOCS)
|
|
|
|
!NetSurf/!RunImage,ff8 : $(OBJS)
|
2003-05-31 22:40:46 +04:00
|
|
|
$(CC) -o $@ $(LDFLAGS) $^
|
2004-03-19 19:31:03 +03:00
|
|
|
u!RunImage,ff8 : $(OBJS)
|
|
|
|
$(CC) -o $@ $(LDFLAGS_SMALL) $^
|
2003-06-05 18:39:54 +04:00
|
|
|
netsurf.zip: !NetSurf/!RunImage,ff8 $(DOCS)
|
2003-05-31 22:40:46 +04:00
|
|
|
rm netsurf.zip; riscos-zip -9vr, netsurf.zip !NetSurf
|
2003-02-09 15:58:15 +03:00
|
|
|
|
2003-06-21 17:18:00 +04:00
|
|
|
# debug targets
|
|
|
|
debug: netsurf
|
|
|
|
netsurf: $(OBJS_DEBUG)
|
|
|
|
$(CC_DEBUG) -o $@ $(LDFLAGS_DEBUG) $^
|
2004-01-02 15:01:23 +03:00
|
|
|
debugro: nsdebug,ff8
|
|
|
|
nsdebug,ff8: $(OBJS_DEBUGRO)
|
2004-05-21 00:06:31 +04:00
|
|
|
$(CC_DEBUG) -o $@ $(LDFLAGS_DEBUG) $^
|
2003-06-21 17:18:00 +04:00
|
|
|
|
2003-05-31 22:40:46 +04:00
|
|
|
# pattern rule for c source
|
|
|
|
$(OBJDIR)/%.o : %.c
|
2003-06-21 17:18:00 +04:00
|
|
|
$(CC) -o $@ -c $(CFLAGS) $<
|
|
|
|
$(OBJDIR_DEBUG)/%.o : %.c
|
|
|
|
$(CC_DEBUG) -o $@ -c $(CFLAGS_DEBUG) $<
|
2003-02-09 15:58:15 +03:00
|
|
|
|
2003-05-31 22:40:46 +04:00
|
|
|
# special cases
|
2003-04-04 19:19:32 +04:00
|
|
|
css/css_enum.c css/css_enum.h: css/css_enums css/makeenum
|
2003-06-05 18:39:54 +04:00
|
|
|
cd ..; /usr/bin/perl netsurf/css/makeenum netsurf/css/css_enum < netsurf/css/css_enums
|
2003-04-06 22:09:34 +04:00
|
|
|
css/parser.c: css/parser.y
|
2003-06-05 18:39:54 +04:00
|
|
|
-cd css; lemon parser.y
|
2004-05-01 21:48:38 +04:00
|
|
|
css/scanner.c: css/scanner.l
|
|
|
|
cd css; re2c -s scanner.l > scanner.c
|
2003-12-29 03:38:59 +03:00
|
|
|
utils/translit.c: transtab
|
|
|
|
cd utils; ./tt2code < transtab > translit.c
|
2003-04-04 19:19:32 +04:00
|
|
|
|
2003-05-31 22:40:46 +04:00
|
|
|
# generate dependencies
|
2003-06-21 17:18:00 +04:00
|
|
|
depend : $(SOURCES) $(SOURCES_DEBUG)
|
|
|
|
-mkdir $(OBJDIR) $(OBJDIR_DEBUG)
|
2003-06-05 18:39:54 +04:00
|
|
|
$(CC) -MM -MG $(CFLAGS) $^ | sed 's|.*\.o:|$(OBJDIR)/&|g' > $@
|
2003-06-21 17:18:00 +04:00
|
|
|
$(CC_DEBUG) -MM -MG $(CFLAGS_DEBUG) $^ | sed 's|.*\.o:|$(OBJDIR_DEBUG)/&|g' >> $@
|
2003-04-04 19:19:32 +04:00
|
|
|
|
2003-05-31 22:40:46 +04:00
|
|
|
# remove generated files
|
|
|
|
clean :
|
2003-06-21 17:18:00 +04:00
|
|
|
-rm $(OBJDIR)/* $(OBJDIR_DEBUG)/* depend css/css_enum.c css/css_enum.h \
|
2003-05-31 22:40:46 +04:00
|
|
|
css/parser.c css/parser.h css/scanner.c css/scanner.h
|