From 6a433c69e35da00f1e3ce2028fc358ccd17a0f5e Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Thu, 29 Sep 2011 01:57:05 -0400 Subject: [PATCH] More manifest restructuring with Makefile rules to simplify the process. --- binary/config.mk | 5 ++++- binary/src/Makefile | 25 +++++++++++++++++++++---- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/binary/config.mk b/binary/config.mk index 019e9a51..a9a17e2d 100644 --- a/binary/config.mk +++ b/binary/config.mk @@ -4,9 +4,12 @@ GECKO_MINOR ?= 0 ABI_OS := $(shell uname -s) ABI_ARCH := $(shell uname -m) ABI_COMPILER := gcc3 -ABI ?= $(GECKO_MAJOR).$(GECKO_MINOR)-$(ABI_OS)_$(ABI_ARCH)-$(ABI_COMPILER) +ABI_PLATFORM ?= $(ABI_OS)_$(ABI_ARCH)-$(ABI_COMPILER) +ABI ?= $(GECKO_MAJOR).$(GECKO_MINOR)-$(ABI_PLATFORM) DEFINES = -DGECKO_MAJOR=$(GECKO_MAJOR) -DGECKO_MINOR=$(GECKO_MINOR) +LIBEXT ?= so + SED := $(shell if [ "xoo" = x$$(echo foo | sed -E 's/f(o)/\1/' 2>/dev/null) ]; \ then echo sed -E; else echo sed -r; \ fi) diff --git a/binary/src/Makefile b/binary/src/Makefile index 65221515..02adcc4f 100644 --- a/binary/src/Makefile +++ b/binary/src/Makefile @@ -17,6 +17,12 @@ CPPSRCS = \ subscriptLoader.cpp \ $(NULL) +HEADERS = \ + config.h \ + dactylUtils.h \ + mozJSLoaderUtils.h \ + $(XPIDLSRCS:%.idl=$(ABI)/%.h) + GECKO_DEFINES = -DMOZILLA_STRICT_API GECKO_INCLUDES = -I$(ABI)/ \ @@ -43,15 +49,16 @@ CPPFLAGS += $(EXCPPFLAGS) XPTS = $(XPIDLSRCS:%.idl=$(XPTDIR)%.xpt) OBJS = $(CPPSRCS:%.cpp=$(OBJDIR)%.o) -HEADERS = $(XPIDLSRCS:%.idl=$(ABI)/%.h) +MANIFEST = $(SODIR)/components.manifest - -all: build +all: build manifest dirs: $(XPTDIR) $(SODIR) $(OBJDIR) depend: .depend +manifest: $(MANIFEST) + module: dirs $(MODULE).so dll: dirs $(MODULE).dll @@ -72,6 +79,16 @@ $(ABI)/%.h: %.idl $(XPTDIR)%.xpt: %.idl $(IDL_XPT) $@ $(GECKO_INCLUDES) $< +$(MANIFEST): Makefile + ( echo interfaces $(XPIDLSRCS:.idl=.xpt); \ + echo binary-component $(MODULE:$(SODIR)%=%).$(LIBEXT) ) \ + >$@ + + manifest=$(SODIR)/../gecko-$(GECKO_MAJOR).manifest; \ + if [ $(GECKO_MAJOR) -lt 8 ]; then part=app; else part=platform; fi; \ + line="manifest $(ABI)/components.manifest abi=$(ABI_PLATFORM) $${part}version<$(GECKO_MAJOR).*"; \ + grep >/dev/null 2>&1 "^$$line$$" $$manifest || echo $$line >>$$manifest + _CPPFLAGS = $(CPPFLAGS) $(CXXFLAGS) $(GECKO_DEFINES) $(GECKO_INCLUDES) $(DEFINES) $(OBJDIR)%.o: %.cpp Makefile @@ -89,6 +106,6 @@ $(MODULE).dll: $(OBJS) $(sort $(XPTDIR) $(SODIR) $(OBJDIR)): mkdir -p $@ -.PHONY: module xpts build clean all depend +.PHONY: module xpts build clean all depend manifest sinclude .depend