Skip to content

Instantly share code, notes, and snippets.

@authorNari
Created July 31, 2013 06:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save authorNari/6119812 to your computer and use it in GitHub Desktop.
Save authorNari/6119812 to your computer and use it in GitHub Desktop.
http://www.cozmixng.org/repos/mozilla/xpcom-sample/how-to-make-xpcom-on-linux.txt を xulrunner 22 でコンパイルしたときのMakefile
CXX = g++
CXXFLAGS = -g -Wall -fno-rtti -fno-exceptions -shared --std=c++0x -fPIC
GECKO_PATH = /home/nari/apps/xulrunner-sdk-22_x86_64
GECKO_SDK_PATH = $(GECKO_PATH)/sdk
GECKO_IDL_PATH = $(GECKO_PATH)/idl
GECKO_INCLUDE_PATH = $(GECKO_PATH)/include
GECKO_LIB_PATH = $(GECKO_PATH)/lib
XPIDL_TYPELIB = python $(GECKO_SDK_PATH)/bin/typelib.py
XPIDL_HEADER = python $(GECKO_SDK_PATH)/bin/header.py
GECKO_INCLUDES = -I$(GECKO_INCLUDE_PATH) -I$(GECKO_PATH)/include/nspr
GECKO_CFLAGS = -DXPCOM_GLUE -D__STDC_LIMIT_MACROS $(GECKO_INCLUDES)
GECKO_LDFLAGS = -L$(GECKO_LIB_PATH)
GECKO_LIBS = -lxpcomglue \
-lnspr4 \
-lplds4
OBJS = myCalc.o myCalcModule.o
IDL = myICalc.idl
XPT = myICalc.xpt
IHEADER = myICalc.h
SHARED = myCalc.so
all: $(XPT) $(IHEADER) $(SHARED)
$(XPT): $(IDL)
$(XPIDL_TYPELIB) -I$(GECKO_IDL_PATH) $(IDL) -o $(XPT)
$(IHEADER): $(IDL)
$(XPIDL_HEADER) -I$(GECKO_IDL_PATH) $(IDL) > $(IHEADER)
$(SHARED): $(IHEADER) $(OBJS)
$(CXX) $(CXXFLAGS) $(GECKO_LDFLAGS) -o $(SHARED) $(OBJS) $(GECKO_LIBS)
clean:
rm -f $(XPT) $(IHEADER) $(OBJS) $(SHARED)
.cpp.o:
$(CXX) $(CXXFLAGS) $(GECKO_CFLAGS) -c $<
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment