From 802f58f10d1d733093b0c285a2ee8bfdf68de414 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 29 Oct 2010 00:54:27 +0000 Subject: Futher simplification of the makefile Use target makefiles to set build sources svn path=/trunk/netsurf/; revision=10916 --- Makefile | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 438df6803..1859b0ad5 100644 --- a/Makefile +++ b/Makefile @@ -189,7 +189,11 @@ else endif endif +# Target paths + OBJROOT = build-$(HOST)-$(TARGET)$(SUBTARGET) +DEPROOT := $(OBJROOT)/deps +TOOLROOT := $(OBJROOT)/tools # 1: Feature name (ie, NETSURF_USE_BMP -> BMP) @@ -284,11 +288,6 @@ LDFLAGS += -lz CFLAGS += -DNETSURF_UA_FORMAT_STRING=\"$(NETSURF_UA_FORMAT_STRING)\" CFLAGS += -DNETSURF_HOMEPAGE=\"$(NETSURF_HOMEPAGE)\" -# ---------------------------------------------------------------------------- -# Target specific setup -# ---------------------------------------------------------------------------- - -include $(TARGET)/Makefile.target # ---------------------------------------------------------------------------- # General make rules @@ -299,13 +298,11 @@ $(OBJROOT)/created: $(Q)$(MKDIR) $(OBJROOT) $(Q)$(TOUCH) $(OBJROOT)/created -DEPROOT := $(OBJROOT)/deps $(DEPROOT)/created: $(OBJROOT)/created $(VQ)echo " MKDIR: $(DEPROOT)" $(Q)$(MKDIR) $(DEPROOT) $(Q)$(TOUCH) $(DEPROOT)/created -TOOLROOT := $(OBJROOT)/tools $(TOOLROOT)/created: $(OBJROOT)/created $(VQ)echo " MKDIR: $(TOOLROOT)" $(Q)$(MKDIR) $(TOOLROOT) @@ -315,9 +312,26 @@ CLEANS := clean-target POSTEXES := -include Makefile.resources +# ---------------------------------------------------------------------------- +# General source file setup +# ---------------------------------------------------------------------------- + include Makefile.sources +# ---------------------------------------------------------------------------- +# Target specific setup +# ---------------------------------------------------------------------------- + +include $(TARGET)/Makefile.target + +# ---------------------------------------------------------------------------- +# Source file setup +# ---------------------------------------------------------------------------- + +ifeq ($(SOURCES),) +$(error Unable to build NetSurf, could not determine set of sources to build) +endif + OBJECTS := $(sort $(addprefix $(OBJROOT)/,$(subst /,_,$(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(patsubst %.s,%.o,$(SOURCES))))))) $(EXETARGET): $(OBJECTS) $(RESOURCES) -- cgit v1.2.3