File:  [mozdev] / abimoz / plugin / Makefile
Revision 1.7: download - view: text, annotated - select for diffs - revision graph
Fri Oct 25 14:42:28 2002 UTC (16 years, 10 months ago) by mikep
Branches: MAIN
CVS tags: HEAD
Upgraded to Mozilla 1.2b and abiword 1.0.3.

    1: #This file is part of AbiMoz.
    2: #
    3: #Makefile - To build the plugin
    4: #Copyright (C) 2001 OEone Corporation
    5: #
    6: #This program is free software; you can redistribute it and/or
    7: #modify it under the terms of the GNU Lesser General Public License
    8: #as published by the Free Software Foundation; either version 2
    9: #of the License, or (at your option) any later version.
   10: #
   11: #This program is distributed in the hope that it will be useful,
   12: #but WITHOUT ANY WARRANTY; without even the implied warranty of
   13: #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   14: #GNU Lesser General Public License for more details.
   15: #
   16: #You should have received a copy of the GNU Lesser General Public License
   17: #along with this program; if not, write to the Free Software
   18: #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
   19: #
   20: #The author of this program can be contacted in writing at
   21: #OEone Corporation, 290 St-Joseph Blvd., Hull, QC J8Y 3Y3, CANADA.
   22: 
   23: #
   24: # Generic XPCOM component makefile
   25: # Copyright OEone Corp.
   26: #
   27: # Authors: Steve Crouse, Garth Smedley, Jody McIntyre
   28: #--------------------------------------------------------
   29: # Usage:
   30: #
   31: #  make clean     - remove output files, does not install
   32: #  make           - build the component and the test program, if not up to date
   33: #  make reset     - delete registration files from mozilla. good idea to run this after install
   34: #  make install   - install xpcom component into mozilla components directory
   35: #  make uninstall - remove xpcom component from mozilla components directory
   36: #  make dist      - tars the distribution files up.
   37: #  make test      - run the test program
   38: #
   39: #  By setting the following environment variable before invoking make, you can control the directories
   40: #  that install and uninstall use:
   41: #
   42: #     DESTDIR               - install/uninstall directory, ( Do not add a trailing slash )
   43: #
   44: #  This Makefile can be customized for use by any XPCOM component
   45: #  by modifying some of the variables below.
   46: #
   47: #     MOZZY                 - Provide the path to your Mozilla installation
   48: #     MOZZYDEV              - Provide the path to your Mozilla development installation
   49: #     LIBRARY_NAME          - Name of the final shared object to be built
   50: #     IDLFILE               - Components IDL file
   51: #     IDL_OUTPUT_BASENAME   - Base name of the .xpt and .h files to be generated
   52: #     SOURCE_FILES          - Source files needed to build component
   53: #     HEADER_FILES          - Header files needed to build component, used for dependencies and distribution
   54: #     EXTRA_DISTFILES       - extra files to be added to the tarball
   55: #     TEST_PROGRAM          - Name of standalone test program
   56: #     TEST_SOURCE_FILES     - Source files needed to build test program
   57: #
   58: #  You can also specify additional include paths and libraries to be linked
   59: #  in using:
   60: #
   61: #     INCLUDES              - Specify any additional include paths here
   62: #     EXTRA_LIBS            - Specify any additional libraries to be linked
   63: #
   64: 
   65: CC = g++
   66: 
   67: # Path to src directory
   68: #
   69: 
   70: SRC = .
   71: 
   72: # set PACKAGE and VERSION for distrbution tarball
   73: PACKAGE=abimoz
   74: VERSION=0.1
   75: 
   76: # Distribution files
   77: # Add any extra files to go in the tarball, by default .so, .idl, .xpt and Makefile are included.
   78: 
   79: EXTRA_DISTFILES= wpplugintst.html README wordp.js wordp.xul tst.png abi
   80: 
   81: # Path to your Mozilla installation
   82: #
   83: MOZZY = $(HOME)/mozilla.cvs/dist/bin
   84: # Path to your Mozilla header files
   85: #
   86: MOZZYDEV = $(HOME)/mozilla.cvs/dist/include
   87: 
   88: # Define the name for the final shared object file
   89: #
   90: LIBRARY_NAME = libWPPlugin.so
   91: 
   92: # Define the name of the executable test program
   93: #
   94: TEST_PROGRAM = TestWPPlugin
   95: TEST_SOURCE_FILES = TestWPPlugin.cpp
   96: 
   97: # Provide the name for the components IDL file
   98: #
   99: IDLFILE = $(SRC)/nsWPPluginControl.idl
  100: 
  101: # Define the base name for the generated .h and .xpt files
  102: #
  103: IDL_OUTPUT_BASENAME = nsWPPluginControl
  104: 
  105: # List the source files needed for building the component
  106: #
  107: SOURCE_FILES = $(SRC)/nsWPPlugin.cpp $(SRC)/pnWPPluginScriptablePeer.cpp $(SRC)/npp_gate.cpp $(SRC)/npunix.c
  108: HEADER_FILES = $(SRC)/nsWPPlugin.h $(SRC)/pnWPPluginScriptablePeer.h
  109: 
  110: # List any custom include paths here
  111: #
  112: INCLUDES = -I./ -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/include/gtk-1.2 -DPLUGIN_DEBUG
  113:  
  114: # List any custom libraries to be linked here
  115: #
  116: EXTRA_LIBS =
  117:  
  118: # -lgtksuperwin
  119: 
  120: # Mozilla directories
  121: 
  122: MOZINCLUDES = -I $(MOZZYDEV) -I $(MOZZYDEV)/nspr -I $(MOZZYDEV)/plugin -I $(MOZZYDEV)/xpcom -I $(MOZZYDEV)/string -I $(MOZZYDEV)/widget -I $(MOZZYDEV)/java 
  123: MOZIDLS = $(MOZZYDEV)/../idl
  124: MOZLIBS = $(MOZZY)
  125: MOZCOMPONENTS = $(MOZZY)/components
  126: MOZINSTALL = $(DESTDIR)/$(MOZCOMPONENTS)
  127: MOZPLUGINS = $(DESTDIR)/$(MOZZY)/plugins
  128: 
  129: XPIDL = $(MOZLIBS)/xpidl
  130: 
  131: # Standard Netscape Portable Runtime and XPCOM libraries to be linked in
  132: #
  133: NSPR_LIBS =
  134: XPCOM_LIBS = -L $(MOZLIBS) -lxpcom
  135: 
  136: LIBS = $(NSPR_LIBS) $(XPCOM_LIBS) $(EXTRA_LIBS)
  137: TESTLIBS = $(NSPR_LIBS) $(XPCOM_LIBS)
  138: 
  139: 
  140: 
  141: # Make targets
  142: #
  143: 
  144: all: $(LIBRARY_NAME) $(IDLFILE) $(TEST_PROGRAM)
  145: 
  146: clean:
  147: 	rm  -f *.obj *.pdb *.res *.map *.lib *.exp *.o *.so *.xpt *.dll $(IDL_OUTPUT_BASENAME).h $(TEST_PROGRAM)
  148: 
  149: reset:
  150: 	rm -f $(MOZZY)/component.reg
  151: 	rm -f $(MOZZY)/chrome/*.rdf
  152: 
  153: install:
  154: 	install -d $(MOZINSTALL)/
  155: 	install $(LIBRARY_NAME) $(MOZINSTALL)/
  156: 	install $(IDL_OUTPUT_BASENAME).xpt $(MOZINSTALL)/
  157: 	install $(LIBRARY_NAME) $(MOZPLUGINS)/
  158: 
  159: uninstall:
  160: 	rm $(MOZINSTALL)/$(LIBRARY_NAME)
  161: 	rm $(MOZINSTALL)/$(IDL_OUTPUT_BASENAME).xpt
  162: 
  163: test:
  164: 	export NSPR_LOG_MODULES=nsComponentManager:5;\
  165:          export NSPR_LOG_FILE=xpcom.log;\
  166:          export MOZILLA_FIVE_HOME=$(MOZZY);\
  167:          export LD_LIBRARY_PATH=$(MOZZY);\
  168:          ./$(TEST_PROGRAM)
  169: 
  170: 
  171: ########################################## ABIWORD SETTINGS ######################################################
  172: ABIWORD_DEFINES= -DABIWORD_APP_NAME=\"WordProcessor\" -DABIWORD_APP_LIBDIR=\"\" -DHAVE_LIBJPEG
  173: ABIWORD_FLAGS= -O2 -Wall -ansi -pedantic -DLINUX -Dlinux -D_POSIX_SOURCE -D_BSD_SOURCE -DHAVE_STRERROR -D_XOPEN_SOURCE -D__USE_XOPEN_EXTENDED -DNDEBUG
  174: ABIBUILD= $(HOME)/rpmbuild/BUILD/abiword-1.0.3
  175: ABIINCLUDES= $(INCLUDES) -I$(ABIBUILD)/abi/src/af/util/xp -I$(ABIBUILD)/abi/src/af/xap/xp -I$(ABIBUILD)/abi/src/wp/ap/unix -I$(ABIBUILD)/abi/src/wp/ap/xp \
  176: -I$(ABIBUILD)/abi/src/af/xap/unix -I$(ABIBUILD)/abi/src/text/ptbl/xp -I$(ABIBUILD)/abi/src/af/ev/unix -I$(ABIBUILD)/abi/src/af/ev/xp \
  177: -I$(ABIBUILD)/abi/src/af/util/unix -I$(ABIBUILD)/abi/src/wp/impexp/xp -I$(ABIBUILD)/abi/src/text/fmt/xp -I$(ABIBUILD)/abi/src/af/gr/xp \
  178: -I$(ABIBUILD)/abi/src/af/gr/unix -I$(ABIBUILD)/abi/src/other/spell/xp -I$(ABIBUILD)/expat/lib
  179: ABILIBPATH= `ls -d $(ABIBUILD)/abi/src/L*`/obj
  180: ABILINKFLAGS= -lgtk -lgdk -lpng -ljpeg -L$(ABILIBPATH) -lAbiGr -lAbiFmt  -lAbiPTbl -lAbiImpExp -lAbiXAp -lAbiWPAp -lAbiEv -lAbiUtil -lAbiWordVer -lAbiSpell\
  181: -lAbi_libwv -L$(ABIBUILD)/psiconv/psiconv/.libs -lpsiconv -L$(ABIBUILD)/expat/lib/.libs -lexpat -lAbiXAp -lAbiWPAp -lAbiGr
  182: ABIOBJS= main.o xap_UnixFrame.o ap_UnixApp.o js_ViewListener.o
  183: 
  184: LIBS += $(ABILINKFLAGS)
  185: ########################################## ABIWORD SETTINGS ######################################################
  186: 
  187: # Builds xpcom shared object
  188: 
  189: $(LIBRARY_NAME): $(SOURCE_FILES) $(HEADER_FILES) $(IDL_OUTPUT_BASENAME) $(ABIOBJS)
  190: 	$(CC) -shared -o $(LIBRARY_NAME) $(SOURCE_FILES) $(ABIOBJS) $(MOZINCLUDES) $(INCLUDES) $(LIBS)
  191: 
  192: main.o: $(SRC)/abi/main.cpp
  193: 	$(CC) -c $(ABIWORD_DEFINES) $(ABIWORD_FLAGS) $(ABIINCLUDES) $(SRC)/abi/main.cpp
  194: 
  195: xap_UnixFrame.o: $(SRC)/abi/xap_UnixFrame.cpp
  196: 	$(CC) -c $(ABIWORD_DEFINES) $(ABIWORD_FLAGS) $(ABIINCLUDES) $(SRC)/abi/xap_UnixFrame.cpp
  197: 
  198: ap_UnixApp.o: $(SRC)/abi/ap_UnixApp.cpp
  199: 	$(CC) -c $(ABIWORD_DEFINES) $(ABIWORD_FLAGS) $(ABIINCLUDES) $(SRC)/abi/ap_UnixApp.cpp
  200: 
  201: js_ViewListener.o: $(SRC)/abi/js_ViewListener.cpp
  202: 	$(CC) -c $(ABIWORD_DEFINES) $(ABIWORD_FLAGS) $(ABIINCLUDES) $(SRC)/abi/js_ViewListener.cpp
  203: 
  204: # Generates .xpt and .h files from the IDL
  205: 
  206: $(IDLFILE): $(IDL_OUTPUT_BASENAME)
  207: 
  208: $(IDL_OUTPUT_BASENAME):
  209: 	$(XPIDL) -m typelib -w -I $(MOZIDLS) -o $(IDL_OUTPUT_BASENAME) $(IDLFILE)
  210: 	$(XPIDL) -m header -w -I $(MOZIDLS) -o $(IDL_OUTPUT_BASENAME) $(IDLFILE)
  211: 
  212: 
  213: # Build test program
  214: 
  215: $(TEST_PROGRAM) : $(TEST_SOURCE_FILES)
  216: 	$(CC) -o $(TEST_PROGRAM) $(TEST_SOURCE_FILES) $(MOZINCLUDES) $(INCLUDES) $(TESTLIBS)  -lplds4 -lplc4 -lnspr4
  217: 
  218: 
  219: 
  220: 
  221: # distribution build
  222: 
  223: DISTFILES= $(SOURCE_FILES) $(HEADER_FILES) $(IDLFILE) $(TEST_SOURCE_FILES) Makefile $(EXTRA_DISTFILES)
  224: 
  225: distdir = $(PACKAGE)-$(VERSION)
  226: 
  227: dist: distdir
  228: 	chmod -R a+r $(distdir)
  229: 	tar czf $(distdir).tar.gz $(distdir)
  230: 	rm -rf $(distdir)
  231: 
  232: distdir:
  233: 	rm -rf $(distdir)
  234: 	mkdir $(distdir)
  235: 	for file in $(DISTFILES); do \
  236: 	if [ -f $$file ]; then\
  237: 		cp -p $$file $(distdir);\
  238: 	fi\
  239: 	done
  240: 	for dir in $(DISTFILES); do \
  241: 	if [ -d $$dir ]; then\
  242: 		cp -r $$dir $(distdir);\
  243: 	fi\
  244: 	done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>