98 lines
3 KiB
Text
98 lines
3 KiB
Text
$NetBSD: patch-ba,v 1.2 2008/06/12 02:14:31 joerg Exp $
|
|
|
|
Libtoolize.
|
|
|
|
--- src/mgd77/makefile.orig 2006-11-08 21:19:37.000000000 +0100
|
|
+++ src/mgd77/makefile 2006-11-08 21:28:05.000000000 +0100
|
|
@@ -21,7 +21,7 @@
|
|
include ../gmtalldeps.macros
|
|
|
|
CFLAGS = $(CC_OPT) $(WIN32) -I$(srcdir) -I$(NETCDF)/include
|
|
-CDF = -L$(NETCDF)/lib -lnetcdf
|
|
+CDF = -Wl,-R$(NETCDF)/lib -L$(NETCDF)/lib -lnetcdf
|
|
|
|
MGD77_H = mgd77.h mgd77defaults.h mgd77_IGF_coeffs.h mgd77sniffer.h mgd77snifferdefaults.h mgd77magref.h mgd77_codes.h
|
|
|
|
@@ -45,7 +45,7 @@
|
|
|
|
MGD77PS = $(MGD77PS_C:.c=)
|
|
|
|
-all: libmgd77.a $(MGD77) $(MGD77PS)
|
|
+all: libmgd77.la $(MGD77) $(MGD77PS)
|
|
$(MGD77_O): $(MGD77_H) $(GMT_H)
|
|
$(MGD77PS_O): $(MGD77_H) $(GMT_H) $(PS_H)
|
|
$(LIB_O): $(LIB_H)
|
|
@@ -53,26 +53,23 @@
|
|
#-------------------------------------------------------------------------------
|
|
|
|
install: all
|
|
+ if [ ! -d $(libdir) ]; then \
|
|
+ mkdir -p $(libdir); \
|
|
+ fi
|
|
+ if [ ! $(libdir) = $(srcdir) ]; then \
|
|
+ $(LIBTOOL) --mode=install $(INSTALL_DATA) libmgd77.la $(libdir); \
|
|
+ fi
|
|
for i in $(MGD77) $(MGD77PS); do \
|
|
- $(INSTALL) $$i$(EXE) $(bindir); \
|
|
+ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$i$(EXE) $(bindir); \
|
|
done
|
|
if [ ! -d $(includedir) ]; then \
|
|
mkdir -p $(includedir); \
|
|
fi
|
|
if [ ! $(includedir) = $(srcdir) ]; then \
|
|
for i in $(LIB_H); do \
|
|
- $(INSTALL) -m 444 $$i $(includedir); \
|
|
+ $(INSTALL_DATA) $$i $(includedir); \
|
|
done; \
|
|
fi
|
|
- if [ ! -d $(libdir) ]; then \
|
|
- mkdir -p $(libdir); \
|
|
- fi
|
|
- if [ ! $(libdir) = $(srcdir) ]; then \
|
|
- $(INSTALL) -m 444 libmgd77.a $(libdir); \
|
|
- if [ -f libmgd77.$(SL) ]; then \
|
|
- $(INSTALL) -m 444 libmgd77.$(SL) $(libdir); \
|
|
- fi; \
|
|
- fi
|
|
|
|
uninstall:
|
|
for i in $(MGD77) $(MGD77PS); do \
|
|
@@ -91,7 +88,7 @@
|
|
fi
|
|
|
|
clean:
|
|
- rm -f *.o
|
|
+ rm -f *.o *.lo
|
|
for i in $(MGD77) $(MGD77PS); do \
|
|
rm -f $$i$(EXE); \
|
|
done
|
|
@@ -103,21 +100,20 @@
|
|
# library
|
|
#-------------------------------------------------------------------------------
|
|
|
|
-libs: libmgd77.a
|
|
+libs: libmgd77.la
|
|
|
|
-libmgd77.a: $(LIB_O)
|
|
- $(AR) cvur $@ $?
|
|
- $(RANLIB) $@
|
|
+libmgd77.la: $(LIB_O)
|
|
+ @$(LIBTOOL) --mode=link $(CC) -o libmgd77.la $(LIB_O:.o=.lo) --version-info 0:0 -rpath $(PLAIN_LIBDIR)
|
|
|
|
#-------------------------------------------------------------------------------
|
|
# program dependencies
|
|
#-------------------------------------------------------------------------------
|
|
|
|
-$(MGD77): $(MGD77_O) libmgd77.a $(GMTLIB)
|
|
- $(CC) $(CFLAGS) $(LDFLAGS) $@.o -L. -lmgd77 -L.. -L$(libdir) -lgmt $(CDF) $(LIBS) -o $@
|
|
+$(MGD77): $(MGD77_O) libmgd77.la
|
|
+ @$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $@.o libmgd77.la ../libgmt.la $(CDF) $(LIBS) -o $@
|
|
|
|
-$(MGD77PS): $(MGD77PS_O) libmgd77.a $(GMTLIB)
|
|
- $(CC) $(CFLAGS) $(LDFLAGS) $@.o -L. -lmgd77 -L.. -L$(libdir) -lgmt -lgmtps -lpsl $(CDF) $(LIBS) -o $@
|
|
+$(MGD77PS): $(MGD77PS_O) libmgd77.la
|
|
+ @$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $@.o libmgd77.la ../libgmt.la ../libgmtps.la ../libpsl.la $(CDF) $(LIBS) -o $@
|
|
|
|
.c.o:
|
|
- $(CC) -c $(CFLAGS) $<
|
|
+ @$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -c $(CFLAGS) $<
|