Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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