summaryrefslogtreecommitdiff
path: root/graphics/netpbm/files/patch-lib-Makefile
blob: 4ed3dec176b226a274c7cc49933525fc06aa9d5f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
--- lib/Makefile.orig	2009-09-18 21:04:37.000000000 +0200
+++ lib/Makefile	2010-05-21 10:36:08.000000000 +0200
@@ -42,6 +42,8 @@
 # Library objects to be linked but not built by Makefile.common:
 LIBOBJECTS_X = util/shhopt.o util/nstring.o util/filename.o
 
+SHLIBOBJECTS = $(patsubst %.o, %.lo, $(LIBOBJECTS))
+
 MANUALS3 = libnetpbm
 MANUALS5 = pbm pgm ppm pnm pam
 
@@ -80,13 +82,17 @@
 
 $(LIBOBJECTS): %.o: %.c importinc
 # Note that the user may have configured -I options into CFLAGS.
+	$(CC) -c $(INCLUDES) -DNDEBUG $(CFLAGS) \
+	  $(CFLAGS_PERSONAL) $(CADD) -o $@ $<
+
+$(SHLIBOBJECTS): %.lo: %.c $(HEADERLINKS)
 	$(CC) -c $(INCLUDES) -DNDEBUG $(CFLAGS) $(CFLAGS_SHLIB) \
 	  $(CFLAGS_PERSONAL) $(CADD) -o $@ $<
 
 MAJ = $(NETPBM_MAJOR_RELEASE)
 MIN = $(NETPBM_MINOR_RELEASE)
 
-SONAME = libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ)
+SONAME = libnetpbm.$(NETPBMLIBSUFFIX).$(SOVER)
 
 ifeq ($(NETPBMLIBTYPE),irixshared)
 # The libxxx.so link is needed to link the executables.
@@ -113,11 +119,8 @@
 # The $(SONAME) link is needed only to test the programs without
 # installing the libraries (in that case, you also need to direct the 
 # dynamic linker to the source directories, e.g. set LD_LIBRARY_PATH).
-$(SONAME): libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ).$(MIN)
-	rm -f $@
-	$(SYMLINK) $< $@
-libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ).$(MIN): $(LIBOBJECTS) $(LIBOBJECTS_X)
-	$(LD) $(LDSHLIB) -o $@ $(LIBOBJECTS) $(LIBOBJECTS_X) \
+$(SONAME): $(SHLIBOBJECTS) $(LIBOBJECTS_X)
+	$(LD) $(LDSHLIB) -o $@ $(SHLIBOBJECTS) $(LIBOBJECTS_X) \
           $(SHLIB_CLIB) -lm $(LADD)
 endif
 
@@ -205,13 +208,10 @@
 .PHONY: install.lib
 ifeq ($(NETPBMLIBTYPE),unixshared)
 # install a Unix-style shared library
-install.lib: $(PKGDIR)/lib $(PKGDIR)/link
-	cd $(PKGDIR)/lib ; rm -f libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ).*
-	$(INSTALL) -c -m $(INSTALL_PERM_LIBD) \
-	  libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ).$(MIN)  $(PKGDIR)/lib/
-	cd $(PKGDIR)/lib/ ; \
-          rm -f libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ); \
-          $(SYMLINK) libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ).$(MIN) $(SONAME)
+install.lib: $(PKGDIR)/lib
+	cd $(PKGDIR)/lib ; rm -f libnetpbm.$(NETPBMLIBSUFFIX).*
+	${BSD_INSTALL_DATA} \
+          $(SONAME) $(PKGDIR)/lib/
 endif
 ifeq ($(NETPBMLIBTYPE),dll)
 #install a Windows DLL shared library
@@ -241,23 +241,23 @@
 # directory when you compile your programs.
 
 %_installhdr: $(PKGDIR)/include
-	$(INSTALL) -c -m $(INSTALL_PERM_HDR) \
+	${BSD_INSTALL_DATA} \
 	  $(SRCDIR)/lib/$(@:%_installhdr=%) $(PKGDIR)/include/;
 
 .PHONY: install.staticlib
-install.staticlib: $(PKGDIR)/link
-	$(INSTALL) -c -m $(INSTALL_PERM_LIBS) libnetpbm.$(STATICLIBSUFFIX) \
-	  $(PKGDIR)/link
+install.staticlib: $(PKGDIR)/lib
+	${BSD_INSTALL_DATA} libnetpbm.$(STATICLIBSUFFIX) \
+	  $(PKGDIR)/lib
 
 # Install a shared library stub -- the ".so" file used at link time to
 # prepare a program for dynamically linking a library at run time 
 .PHONY: install.sharedlibstub
-install.sharedlibstub: $(PKGDIR)/link
+install.sharedlibstub: $(PKGDIR)/lib
 ifeq ($(NETPBMLIBTYPE),unixshared)
 # install the link-time (.so) links to the runtime libraries
-	cd $(PKGDIR)/link ; \
+	cd $(PKGDIR)/lib ; \
           rm -f libnetpbm.$(NETPBMLIBSUFFIX); \
-          $(SYMLINK) ../lib/libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ) \
+          $(SYMLINK) $(SONAME) \
             libnetpbm.$(NETPBMLIBSUFFIX)
 endif
 ifeq ($(NETPBMLIBTYPE),dll)