Mozilla/mozilla/java/xpcom/test/Makefile.test
frankm%eng.sun.com 4f6fb60c68 Some cleanup, and update to new mozilla source. In particular:
- Removed #if 0 code in genproxy.c and elsewhere.

- Used jlong_* macros for portability (and defined in xpjava.h if not
  elsewhere)

- Commented out calls to PR_Atomic{In,De}crement in JSSample.cpp, and began
  to use "official" XPCOM macros.

- Removed Java interfaces for test components; will be autogenerated by
  xpidl and/or genproxy.

- Extend genproxy to generate interfaces.

- Updated README with note on the jni.h problem


git-svn-id: svn://10.0.0.236/trunk@47409 18797224-902f-48f8-a5cc-f745e15eee43
1999-09-14 21:56:19 +00:00

92 lines
2.1 KiB
Makefile

# Makefile
MOZILLA=../../..
CC=gcc
CPP=g++
CFLAGS=-Wall -g -fno-rtti -fno-handle-exceptions -pipe
SHLIB_FLAGS=-fpic
SHLIB_LDFLAGS=-shared
DEFINES=-DXP_UNIX
INCLUDE=-I$(MOZILLA)/dist/include -I$(MOZILLA)/xpcom/public -I../src -I$(JDKHOME)/include -I$(JDKHOME)/include/solaris -I$(JDKHOME)/include/linux
LIBS=-L$(MOZILLA)/dist/lib -lxptinfo -lxptcmd -lxptcall -lxpt -lxpcom -lplds3 -lplc3 -lnspr3
COMPDIR=$(MOZILLA)/dist/bin/components
XPIDL=$(MOZILLA)/dist/bin/xpidl
GENPROXY=$(MOZILLA)/dist/bin/genproxy
JAVAC=$(JDKHOME)/bin/javac
CLASSDIR=$(MOZILLA)/dist/classes
TEST_CLASSES=XPCTest.class
PROXY_JAR=sample.jar
PROXY_DIR=_genproxy
.SUFFIXES: .java .class .cpp .o
all: sample xptest $(TEST_CLASSES) $(PROXY_JAR)
#
# Build class files.
#
.java.class:
$(JAVAC) -g -d . -classpath $(CLASSDIR):. $<
#
# Compile C++.
#
.cpp.o:
$(CPP) $(CFLAGS) $(DEFINES) $(INCLUDE) $(SHLIB_FLAGS) -c $<
#
# Sample XPCOM module.
#
sample: JSISample.h $(COMPDIR)/libxpjtest.so $(COMPDIR)/xpjtest.xpt
#
# Build sample header & typelib
#
JSISample.cpp: JSISample.h
JSISample.h: JSISample.idl
$(XPIDL) -w -v -m header -I $(MOZILLA)/dist/idl JSISample.idl
$(COMPDIR)/xpjtest.xpt: JSISample.idl
$(XPIDL) -w -v -m typelib -o $(COMPDIR)/xpjtest -I $(MOZILLA)/dist/idl JSISample.idl
#
# Sample object shared library
#
libxpjtest.so: JSISample.h JSSample.o
$(CPP) $(SHLIB_LDFLAGS) -L$(MOZILLA)/dist/lib -lxpcom -o libxpjtest.so JSSample.o
chmod +x libxpjtest.so
$(COMPDIR)/libxpjtest.so: libxpjtest.so
../../../config/nsinstall -R -m 555 libxpjtest.so $(COMPDIR)
#
# C++ test program
#
xptest: xptest.o ../src/libxpjava.so
$(CPP) -g -Wall -o xptest $(LIBS) -L ../src -lxpjava xptest.o
xptest.cpp: ../src/xpjava.h
$(PROXY_JAR): $(GENPROXY) $(COMPDIR)/xpjtest.xpt
- mkdir $(PROXY_DIR)
$(GENPROXY) -d $(PROXY_DIR) $(COMPDIR)/xpjtest.xpt
$(GENPROXY) -i -d $(PROXY_DIR) $(COMPDIR)/xpjtest.xpt
$(JAVAC) -g -d $(PROXY_DIR) -classpath $(CLASSDIR):. $(PROXY_DIR)/*.java
(cd $(PROXY_DIR); jar cf ../$(PROXY_JAR) org)
clean:
$(RM) -r *.o *.so core xptest $(COMPDIR)/libxpjtest.so $(COMPDIR)/xpjtest.xpt JSISample.h $(TEST_CLASSES) $(PROXY_JAR) $(PROXY_DIR)