- add win32 DLL section to the makefile. Use entirely different

target names so that both sets of rules can coexist in the same file.
  The configure script selects which one to use.
- use patterns to build plugins.
- remove Makefile, which was specific to win32.
This commit is contained in:
Bryce Denney 2002-10-16 02:55:16 +00:00
parent e972168d39
commit d528a0f020
2 changed files with 25 additions and 52 deletions

View File

@ -1,41 +0,0 @@
top_builddir = ..
top_srcdir = ./..
srcdir = .
CXX=g++
CXXFLAGS=-mno-cygwin -I${top_srcdir}/libltdl -ggdb
LDFLAGS=-mno-cygwin -no-undefined -ggdb
LIBS= ${top_builddir}/libltdl/.libs/libltdlc.al
LIBTOOL=$(SHELL) $(top_builddir)/libtool
RPATH=`pwd`/lib
all: uselib module1.dll module2.dll
uselib: main.cc main.h
$(CXX) $(CXXFLAGS) -c -DDLL_EXPORT -o main.o ${srcdir}/main.cc
dlltool --output-def uselib.def main.o
dlltool --dllname uselib.exe --def uselib.def --output-lib uselib.a
dlltool --dllname uselib.exe --output-exp uselib.exp --def uselib.def
$(CXX) $(CXXFLAGS) -o uselib uselib.exp main.o ${LIBS}
#rm uselib.exp uselib.def
module1.dll: module1.cc main.h main.cc
$(CXX) $(CXXFLAGS) -shared -o module1.dll ${srcdir}/module1.cc uselib.a
module2.dll: module2.cc main.h main.cc
$(CXX) $(CXXFLAGS) -shared -o module2.dll ${srcdir}/module2.cc uselib.a
%.o: %.cc
$(CXX) $(CXXFLAGS) -c $<
test:
@echo "*** Running test in `pwd`"
-./uselib
@echo "*** Test done in `pwd`"
clean:
-$(LIBTOOL) rm libmodule1.la module1.lo libmodule2.la module2.lo
-rm -rf *.o *.lo *.la *.dll uselib.exe bin lib uselib uselib.exe
-rm -rf .libs

View File

@ -11,9 +11,9 @@ LIBS=@LIBS@ @LIBLTDL@
LIBTOOL=@LIBTOOL@ LIBTOOL=@LIBTOOL@
RPATH=`pwd`/lib RPATH=`pwd`/lib
# select whether to use libtool or win32-specific target # select whether to use libtool or win32-specific target.
all: all_libtool # This should either be all_libtool or all_win32_dlltool.
#all: all_win32 all: @PLUGIN_MAKEFILE_TARGET@
########### libtool makefile for all platforms except win32 ########### ########### libtool makefile for all platforms except win32 ###########
all_libtool: uselib libmodule1.la libmodule2.la all_libtool: uselib libmodule1.la libmodule2.la
@ -21,18 +21,32 @@ all_libtool: uselib libmodule1.la libmodule2.la
uselib: main.lo uselib: main.lo
$(LIBTOOL) $(CXX) -export-dynamic $(LDFLAGS) -o uselib main.lo $(LIBS) $(LIBTOOL) $(CXX) -export-dynamic $(LDFLAGS) -o uselib main.lo $(LIBS)
libmodule1.la: module1.lo lib%.la: %.lo
$(LIBTOOL) $(CXX) -module $(LDFLAGS) -o libmodule1.la module1.lo -rpath ${RPATH} $(LIBTOOL) $(CXX) -module $(LDFLAGS) -o $@ $< -rpath ${RPATH}
mkdir -p lib bin mkdir -p lib bin
$(LIBTOOL) cp libmodule1.la ${RPATH} $(LIBTOOL) cp $@ ${RPATH}
libmodule2.la: module2.lo
$(LIBTOOL) $(CXX) -module $(LDFLAGS) -o libmodule2.la module2.lo -rpath ${RPATH}
mkdir -p lib bin
$(LIBTOOL) cp libmodule2.la ${RPATH}
%.lo: %.cc %.lo: %.cc
$(LIBTOOL) $(CXX) $(CXXFLAGS) -c $< $(LIBTOOL) $(CXX) $(CXXFLAGS) -c $<
#######################################################################
############# makefile for building plugin DLLs for win32 #############
all_win32_dlltool: uselib.exe module1.dll module2.dll
uselib.exe: main.cc main.h
$(CXX) $(CXXFLAGS) -c -DDLL_EXPORT -o main.o ${srcdir}/main.cc
dlltool --output-def uselib.def main.o
dlltool --dllname uselib.exe --def uselib.def --output-lib uselib.a
dlltool --dllname uselib.exe --output-exp uselib.exp --def uselib.def
$(CXX) $(CXXFLAGS) -o uselib.exe uselib.exp main.o ${LIBS}
#rm uselib.exp uselib.def
%.dll: %.o uselib.exe
$(CXX) $(CXXFLAGS) -shared -o $@ $< uselib.a
%.o: %.cc
$(CXX) $(CXXFLAGS) -c $<
#######################################################################
test: test:
@echo "*** Running test in `pwd`" @echo "*** Running test in `pwd`"