Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: d01ae86df9
Fetching contributors…

Cannot retrieve contributors at this time

105 lines (83 sloc) 3.904 kb
#
# Copyright (c) 2011, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
#
ENVP= MACOSX_DEPLOYMENT_TARGET=10.6
OUTPUTDIR = Release/MacOS
OUTPUTNAME = extension.bundle
OUTPUTNAME32 = extension.32.bundle
EXTENSIONDIR = xpi-contents
GECKODIR = gecko-sdk
GECKODIR32 = $(wildcard gecko-sdk-32)
EXCLUDEFILES = src/dllmain.cpp
CCFLAGS =
#
# nothing to configure below this line
#
LIBS =
GENTYPELIB = /usr/bin/python $(GECKODIR)/sdk/bin/typelib.py
GENHEADER = /usr/bin/python $(GECKODIR)/sdk/bin/header.py
IDLDIR = idl
GECKOLIB = lib
GECKOINC = include
GECKOFLAGS = -fno-rtti -fno-exceptions -fshort-wchar -fPIC -fno-common
GECKODEF = -DXP_UNIX -DXP_MACOS
IDLFILES = $(filter-out $(EXCLUDEFILES),$(wildcard src/*.idl))
CPPFILES = $(filter-out $(EXCLUDEFILES),$(wildcard src/*.cpp))
MAKEDEPEND = $(CC) -MM
SED = sed
TYPELIBS = $(patsubst %.idl,%.xpt,$(IDLFILES))
HEADERS = $(patsubst %.idl,%.h,$(IDLFILES))
OBJFILES = $(patsubst %.cpp,%.o,$(CPPFILES))
OBJFILES32 = $(patsubst %.cpp,%.32.o,$(CPPFILES))
DEPFILES := $(patsubst %.cpp,%.d,$(CPPFILES))
OUTPUTS := $(OUTPUTDIR)/$(OUTPUTNAME)
ifneq "$(GECKODIR32)" ""
OUTPUTS := $(OUTPUTS) $(OUTPUTDIR)/$(OUTPUTNAME32)
DEPFILES := $(DEPFILES) $(patsubst %.cpp,%.32.d,$(CPPFILES))
endif
.PHONY: all clean deploy
-include $(DEPFILES)
all: $(TYPELIBS) $(HEADERS) $(OUTPUTS)
clean:
rm -f $(TYPELIBS) $(HEADERS) $(OBJFILES) $(OBJFILES32) $(DEPFILES) $(OUTPUTS)
deploy: all
cp $(OUTPUTS) $(EXTENSIONDIR)/components/
cp $(TYPELIBS) $(EXTENSIONDIR)/components/
$(OUTPUTDIR):
mkdir -p $(OUTPUTDIR)
$(OUTPUTDIR)/$(OUTPUTNAME): $(OUTPUTDIR) $(OBJFILES)
$(CXX) $(CCFLAGS) $(OBJFILES) -bundle -framework OpenCL -L$(GECKODIR)/$(GECKOLIB) -I$(GECKODIR)/$(GECKOINC) -lxpcomglue_s -lxpcom -lnspr4 -lmozalloc $(GECKODIR)/$(GECKOLIB)/XUL -o $@
$(OUTPUTDIR)/$(OUTPUTNAME32): $(OUTPUTDIR) $(OBJFILES32)
$(CXX) $(CCFLAGS) $(OBJFILES32) -bundle -framework OpenCL -L$(GECKODIR32)/$(GECKOLIB) -lxpcomglue_s -lxpcom -lnspr4 -lmozalloc $(GECKODIR32)/$(GECKOLIB)/XUL -arch i386 -o $@
%.xpt: %.idl
$(GENTYPELIB) -o $@ -I $(GECKODIR)/$(IDLDIR) -I $(dir $<) $<
%.h: %.idl
$(GENHEADER) -o $@ -I $(GECKODIR)/$(IDLDIR) -I $(dir $<) $<
%.o: %.cpp
@$(MAKEDEPEND) $(GECKODEF) -I $(GECKODIR)/$(GECKOINC) $(GECKOFLAGS) $< | $(SED) -e 's|.*:|$*.o:|' > $*.d
$(CXX) $(CCFLAGS) -c $< -o $@ -I $(dir $<) -I $(GECKODIR)/$(GECKOINC) $(GECKOFLAGS) $(GECKODEF)
%.32.o: %.cpp
@$(MAKEDEPEND) $(GECKODEF) -I $(GECKODIR32)/$(GECKOINC) $(GECKOFLAGS) $< | $(SED) -e 's|.*:|$*.32.o:|' > $*.32.d
$(CXX) $(CCFLAGS) -c $< -o $@ -I $(dir $<) -I $(GECKODIR32)/$(GECKOINC) $(GECKOFLAGS) $(GECKODEF) -arch i386
Jump to Line
Something went wrong with that request. Please try again.