CXX   = c++

CPPFLAGS +=     -fno-rtti              \
                -fno-exceptions        \
                -shared

# Change this to point at your Gecko SDK directory.
GECKO_SDK_PATH = /home/hashao/moz/gecko-sdk

# GCC only define which allows us to not have to #include mozilla-config
# in every .cpp file.  If your not using GCC remove this line and add
# #include "mozilla-config.h" to each of your .cpp files.
GECKO_CONFIG_INCLUDE = -include mozilla-config.h

GECKO_DEFINES  = -DXPCOM_GLUE -DMOZILLA_STRICT_API

GECKO_INCLUDES = -I $(GECKO_SDK_PATH)/include            \
                 -I $(GECKO_SDK_PATH)/xpcom/include      \
                 -I $(GECKO_SDK_PATH)/nspr/include       \
                 -I $(GECKO_SDK_PATH)/string/include     \
                 -I $(GECKO_SDK_PATH)/embedstring/include

GECKO_LDFLAGS =  -L $(GECKO_SDK_PATH)/xpcom/bin -lxpcomglue \
                 -L $(GECKO_SDK_PATH)/nspr/bin -lnspr4      \
                 -L $(GECKO_SDK_PATH)/nspr/bin -lplds4      \
                 -L $(GECKO_SDK_PATH)/embedstring/bin/ -lembedstring

build:
	$(CXX) -o MozShim.so $(GECKO_CONFIG_INCLUDE) $(GECKO_DEFINES) $(GECKO_INCLUDES) $(GECK\
O_LDFLAGS) $(CPPFLAGS) $(CXXFLAGS) TransString.cpp
	chmod +x MozShim.so

clean:
	rm MozShim.so
