68 lines
2 KiB
Text
68 lines
2 KiB
Text
--- Makefile.in.orig 1997-05-23 10:18:22.000000000 +0800
|
|
+++ Makefile.in 2014-01-09 20:47:32.000000000 +0800
|
|
@@ -13,6 +13,10 @@ LDFLAGS = @LDFLAGS@
|
|
RANLIB = @RANLIB@
|
|
|
|
LIBS = @LIBS@ @X_LIBS@ @X_PRE_LIBS@ -lXmu -lXaw -lXt -lX11 @X_EXTRA_LIBS@
|
|
+LIBS+= -Wl,-rpath,$(LOCALBASE)/lib
|
|
+SHLDFLAGS= -shared -x -soname $@
|
|
+DNDLIB= libDnd.so.1
|
|
+DNDPLUSLIB= libDnd++.so.1
|
|
|
|
prefix = @prefix@
|
|
exec_prefix = @exec_prefix@
|
|
@@ -23,20 +27,30 @@ COMPILE = $(CC) $(INCLUDES) $(CFLAGS) -c
|
|
CXXCOMPILE = $(CXX) $(INCLUDES) $(CXXFLAGS) -c
|
|
LINK = $(CC) $(LDFLAGS) -o $@
|
|
|
|
+SOCOMPILE= $(COMPILE) -fpic
|
|
+SOCXXCOMPILE = $(CXX) $(INCLUDES) $(CXXFLAGS) -c -fpic
|
|
+
|
|
default: all
|
|
|
|
-all: libC libCpp dndtest
|
|
+all: libC libCpp dndtest libC-so libCpp-so
|
|
|
|
install: libCpp libC
|
|
- install -d $(INC_DIR)
|
|
- install DragAndDrop.h DragAndDropTypes.h $(INC_DIR)
|
|
- install -d $(LIB_DIR)
|
|
- install libDnd.a libDnd++.a $(LIB_DIR)
|
|
+ install -d $(DESTDIR)$(INC_DIR)
|
|
+ install -c -m 644 DragAndDrop.h DragAndDropTypes.h $(DESTDIR)$(INC_DIR)
|
|
+ install -d $(DESTDIR)$(LIB_DIR)
|
|
+ install -c -m 644 libDnd.a libDnd++.a $(DESTDIR)$(LIB_DIR)
|
|
+ install -c $(DNDLIB) $(DNDPLUSLIB) $(DESTDIR)$(LIB_DIR)
|
|
+ cd $(DESTDIR)/$(LIB_DIR); ln -sf $(DNDLIB) libDnd.so
|
|
+ cd $(DESTDIR)/$(LIB_DIR); ln -sf $(DNDPLUSLIB) libDnd++.so
|
|
|
|
libC: libDnd.a
|
|
|
|
libCpp: libDnd++.a
|
|
|
|
+libC-so: $(DNDLIB)
|
|
+
|
|
+libCpp-so: $(DNDPLUSLIB)
|
|
+
|
|
dndtest: dndtest.c libDnd.a
|
|
rm -f dndtest
|
|
$(COMPILE) dndtest.c
|
|
@@ -57,6 +71,16 @@ libDnd++.a: DragAndDrop.c
|
|
$(AR) cru libDnd++.a DragAndDrop.o
|
|
$(RANLIB) libDnd++.a
|
|
|
|
-clean:
|
|
- rm -f *.o *.cxx *.a dndtest *~ *bak
|
|
+$(DNDLIB): DragAndDrop.c
|
|
+ rm -f DragAndDrop.so
|
|
+ $(SOCOMPILE) -o DragAndDrop.so DragAndDrop.c
|
|
+ $(LD) $(SHLDFLAGS) -o $(DNDLIB) DragAndDrop.so
|
|
|
|
+$(DNDPLUSLIB): DragAndDrop.c
|
|
+ rm -f DragAndDrop.so DragAndDrop.cxx
|
|
+ ln -s DragAndDrop.c DragAndDrop.cxx
|
|
+ $(SOCXXCOMPILE) -o DragAndDrop.so DragAndDrop.cxx
|
|
+ $(LD) $(SHLDFLAGS) -o $(DNDPLUSLIB) DragAndDrop.so
|
|
+
|
|
+clean:
|
|
+ rm -f *.o *.so *.cxx *.a dndtest *~ *bak
|