Annotation of abimoz/plugin/Makefile, revision 1.6

1.3       mikep       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: 
1.1       mikep      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
1.4       mostafa    73: PACKAGE=abimoz
1.2       mostafa    74: VERSION=0.1
1.1       mikep      75: 
                     76: # Distribution files
                     77: # Add any extra files to go in the tarball, by default .so, .idl, .xpt and Makefile are included.
                     78: 
1.6     ! mostafa    79: EXTRA_DISTFILES= wpplugintst.html README wordp.js wordp.xul tst.png abi
1.1       mikep      80: 
                     81: # Path to your Mozilla installation
                     82: #
                     83: MOZZY = /usr/lib/oemozilla
                     84: # Path to your Mozilla header files
                     85: #
1.4       mostafa    86: MOZZYDEV = /usr/include/mozilla
1.1       mikep      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)/nsWPPluginFactory.cpp $(SRC)/nsWPPlugin.cpp
                    108: HEADER_FILES = $(SRC)/nsWPPluginFactory.h $(SRC)/nsWPPlugin.h
                    109: 
                    110: # List any custom include paths here
                    111: #
1.2       mostafa   112: INCLUDES = -I./ -I/usr/include/glib-1.2 -I/usr/lib/glib/include -DPLUGIN_DEBUG
                    113:  
                    114: #-I ./ -I/usr/include/gtk-1.2 -I/usr/include/libole2 -I/usr/local/include -fno-rtti
1.1       mikep     115: 
                    116: # List any custom libraries to be linked here
                    117: #
1.2       mostafa   118: EXTRA_LIBS =
                    119:  
                    120: # -lgtksuperwin
1.1       mikep     121: 
                    122: # Mozilla directories
1.2       mostafa   123: 
                    124: MOZINCLUDES = -I $(MOZZYDEV) -I $(MOZZYDEV)/nspr -I $(MOZZYDEV)/plugin -I $(MOZZYDEV)/xpcom -I $(MOZZYDEV)/string -I $(MOZZYDEV)/widget
1.1       mikep     125: MOZIDLS = $(MOZZYDEV)/idl
                    126: MOZLIBS = $(MOZZY)
                    127: MOZCOMPONENTS = $(MOZZY)/components
                    128: MOZINSTALL = $(DESTDIR)/$(MOZCOMPONENTS)
1.4       mostafa   129: MOZPLUGINS = $(DESTDIR)/$(MOZZY)/plugins
1.1       mikep     130: 
                    131: XPIDL = $(MOZLIBS)/xpidl
                    132: 
                    133: # Standard Netscape Portable Runtime and XPCOM libraries to be linked in
                    134: #
                    135: NSPR_LIBS =
                    136: XPCOM_LIBS = -L $(MOZLIBS) -lxpcom
                    137: 
                    138: LIBS = $(NSPR_LIBS) $(XPCOM_LIBS) $(EXTRA_LIBS)
                    139: TESTLIBS = $(NSPR_LIBS) $(XPCOM_LIBS)
                    140: 
                    141: 
                    142: 
                    143: # Make targets
                    144: #
                    145: 
                    146: all: $(LIBRARY_NAME) $(IDLFILE) $(TEST_PROGRAM)
                    147: 
                    148: clean:
1.5       mostafa   149:        rm  -f *.obj *.pdb *.res *.map *.lib *.exp *.o *.dll $(IDL_OUTPUT_BASENAME).h $(TEST_PROGRAM)
1.1       mikep     150: 
                    151: reset:
                    152:        rm -f $(MOZZY)/component.reg
                    153:        rm -f $(MOZZY)/chrome/*.rdf
                    154: 
                    155: install:
                    156:        install -d $(MOZINSTALL)/
                    157:        install $(LIBRARY_NAME) $(MOZINSTALL)/
                    158:        install $(IDL_OUTPUT_BASENAME).xpt $(MOZINSTALL)/
                    159:        install $(LIBRARY_NAME) $(MOZPLUGINS)/
                    160: 
                    161: uninstall:
                    162:        rm $(MOZINSTALL)/$(LIBRARY_NAME)
                    163:        rm $(MOZINSTALL)/$(IDL_OUTPUT_BASENAME).xpt
                    164: 
                    165: test:
                    166:        export NSPR_LOG_MODULES=nsComponentManager:5;\
                    167:          export NSPR_LOG_FILE=xpcom.log;\
                    168:          export MOZILLA_FIVE_HOME=$(MOZZY);\
                    169:          export LD_LIBRARY_PATH=$(MOZZY);\
                    170:          ./$(TEST_PROGRAM)
                    171: 
                    172: 
1.2       mostafa   173: ########################################## ABIWORD SETTINGS ######################################################
1.4       mostafa   174: ABIWORD_DEFINES= -DABIWORD_APP_NAME=\"WordProcessor\" -DABIWORD_APP_LIBDIR=\"\"
1.2       mostafa   175: ABIWORD_FLAGS= -O2 -Wall -ansi -pedantic -DLINUX -Dlinux -D_POSIX_SOURCE -D_BSD_SOURCE -DHAVE_STRERROR -D_XOPEN_SOURCE -D__USE_XOPEN_EXTENDED -DNDEBUG
1.4       mostafa   176: ABIBUILD= /home/mostafah/abiword-0.9.4.1
1.2       mostafa   177: 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 \
                    178: -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 \
                    179: -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 \
                    180: -I$(ABIBUILD)/abi/src/af/gr/unix -I$(ABIBUILD)/abi/src/other/spell/xp -I$(ABIBUILD)/expat/lib
                    181: ABILIBPATH= $(ABIBUILD)/abi/src/Linux_2.4.6_i386_OBJ/obj
                    182: ABILINKFLAGS= -lgtk -lgdk -lpng -L$(ABILIBPATH) -lAbiGr -lAbiFmt  -lAbiPTbl -lAbiImpExp -lAbiXAp -lAbiWPAp -lAbiEv -lAbiUtil -lAbiWordVer -lAbiSpell\
                    183: -lAbi_libwv -L$(ABIBUILD)/psiconv/psiconv/.libs -lpsiconv -L$(ABIBUILD)/expat/lib/.libs -lexpat -lAbiXAp -lAbiWPAp -lAbiGr
1.6     ! mostafa   184: ABIOBJS= main.o xap_UnixFrame.o ap_UnixApp.o js_ViewListener.o
1.2       mostafa   185: 
                    186: LIBS += $(ABILINKFLAGS)
                    187: ########################################## ABIWORD SETTINGS ######################################################
                    188: 
1.1       mikep     189: # Builds xpcom shared object
                    190: 
1.2       mostafa   191: $(LIBRARY_NAME): $(SOURCE_FILES) $(HEADER_FILES) $(IDL_OUTPUT_BASENAME) $(ABIOBJS)
                    192:        $(CC) -shared -o $(LIBRARY_NAME) $(SOURCE_FILES) $(ABIOBJS) $(MOZINCLUDES) $(INCLUDES) $(LIBS)
                    193: 
                    194: main.o: $(SRC)/abi/main.cpp
                    195:        $(CC) -c $(ABIWORD_DEFINES) $(ABIWORD_FLAGS) $(ABIINCLUDES) $(SRC)/abi/main.cpp
                    196: 
                    197: xap_UnixFrame.o: $(SRC)/abi/xap_UnixFrame.cpp
                    198:        $(CC) -c $(ABIWORD_DEFINES) $(ABIWORD_FLAGS) $(ABIINCLUDES) $(SRC)/abi/xap_UnixFrame.cpp
                    199: 
                    200: ap_UnixApp.o: $(SRC)/abi/ap_UnixApp.cpp
                    201:        $(CC) -c $(ABIWORD_DEFINES) $(ABIWORD_FLAGS) $(ABIINCLUDES) $(SRC)/abi/ap_UnixApp.cpp
1.1       mikep     202: 
1.6     ! mostafa   203: js_ViewListener.o: $(SRC)/abi/js_ViewListener.cpp
        !           204:        $(CC) -c $(ABIWORD_DEFINES) $(ABIWORD_FLAGS) $(ABIINCLUDES) $(SRC)/abi/js_ViewListener.cpp
1.1       mikep     205: 
                    206: # Generates .xpt and .h files from the IDL
                    207: 
                    208: $(IDLFILE): $(IDL_OUTPUT_BASENAME)
                    209: 
                    210: $(IDL_OUTPUT_BASENAME):
                    211:        $(XPIDL) -m typelib -w -I $(MOZIDLS) -o $(IDL_OUTPUT_BASENAME) $(IDLFILE)
                    212:        $(XPIDL) -m header -w -I $(MOZIDLS) -o $(IDL_OUTPUT_BASENAME) $(IDLFILE)
                    213: 
                    214: 
                    215: # Build test program
                    216: 
                    217: $(TEST_PROGRAM) : $(TEST_SOURCE_FILES)
1.2       mostafa   218:        $(CC) -o $(TEST_PROGRAM) $(TEST_SOURCE_FILES) $(MOZINCLUDES) $(INCLUDES) $(TESTLIBS)  -lplds4 -lplc4 -lnspr4
1.1       mikep     219: 
                    220: 
                    221: 
                    222: 
                    223: # distribution build
                    224: 
                    225: DISTFILES= $(SOURCE_FILES) $(HEADER_FILES) $(IDLFILE) $(TEST_SOURCE_FILES) Makefile $(EXTRA_DISTFILES)
                    226: 
                    227: distdir = $(PACKAGE)-$(VERSION)
                    228: 
                    229: dist: distdir
                    230:        chmod -R a+r $(distdir)
                    231:        tar czf $(distdir).tar.gz $(distdir)
                    232:        rm -rf $(distdir)
                    233: 
                    234: distdir:
                    235:        rm -rf $(distdir)
                    236:        mkdir $(distdir)
                    237:        for file in $(DISTFILES); do \
1.2       mostafa   238:        if [ -f $$file ]; then\
                    239:                cp -p $$file $(distdir);\
                    240:        fi\
                    241:        done
                    242:        for dir in $(DISTFILES); do \
                    243:        if [ -d $$dir ]; then\
                    244:                cp -r $$dir $(distdir);\
                    245:        fi\
1.1       mikep     246:        done

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