about summary refs log tree commit diff
path: root/lib/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Makefile')
-rw-r--r--lib/Makefile48
1 files changed, 38 insertions, 10 deletions
diff --git a/lib/Makefile b/lib/Makefile
index bc758df4..a633cf7b 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -33,7 +33,6 @@ LIBOBJECTS = libpm.o pmfileio.o fileio.o colorname.o \
 	libpgm1.o libpgm2.o \
 	libppm1.o libppm2.o libppmcmap.o libppmcolor.o libppmfuzzy.o \
 	libppmd.o ppmdfont.o standardppmdfont.o path.o \
-	libppmfloyd.o \
 	libpnm1.o libpnm2.o libpnm3.o \
 	libpam.o libpamread.o libpamwrite.o \
 	libpamn.o libpammap.o libpamcolor.o \
@@ -48,6 +47,10 @@ LIBOBJECTS_X = \
   util/matrix.o \
   util/nsleep.o \
   util/nstring.o \
+  util/rand.o \
+  util/randsysrand.o \
+  util/randsysrandom.o \
+  util/randmersenne.o \
   util/runlength.o \
   util/shhopt.o \
   util/token.o \
@@ -59,7 +62,7 @@ MANUALS5 = pbm pgm ppm pnm pam
 INTERFACE_HEADERS = colorname.h \
 	pam.h pamdraw.h pammap.h pbm.h pbmfont.h pbmfontdata.h \
 	pgm.h pm.h pm_gamma.h pm_system.h pnm.h \
-	ppm.h ppmcmap.h ppmdfont.h ppmdraw.h ppmfloyd.h \
+	ppm.h ppmcmap.h ppmdfont.h ppmdraw.h \
 	util/mallocvar.h util/runlength.h util/shhopt.h \
 
 DATAFILES = rgb.txt
@@ -93,11 +96,36 @@ $(LIBOBJECTS): CFLAGS_TARGET=$(CFLAGS_SHLIB)
 
 libpbm3.o: CFLAGS_TARGET+=$(CFLAGS_SSE)
 
-$(LIBOBJECTS): %.o: %.c importinc
+# libsystem_dummy.o is in the following rule because we like to compile it
+# even when it's not part of the library, just for a test.
+
+$(LIBOBJECTS) libsystem_dummy.o: %.o: %.c importinc
 	$(CC) -c $(INCLUDES) $(CFLAGS_ALL) -o $@ $<
 
-MAJ = 11
-MIN = $(NETPBM_MINOR_RELEASE)
+# The major number increases when there is a non-backward-compatible change
+# to the library at the binary level, meaning any client of the library needs
+# to keep using the old library until it has been recompiled for the new
+# library.  We try very hard never to lose backward compatibility at the
+# source level, which would mean the client source code has to be modified
+# before it can use the new library.
+#
+# The major number might seem like it corresponds to the major version number
+# of Netpbm, but it does not.  It is independent.
+#
+# Adding functions is backward compatible, so does not require a major number
+# change.
+#
+# The minor number must always increase within a major number.
+#
+# It is convenient to have the minor number equal to the minor version number
+# of Netpbm, but when we changed the Netpbm major version number from 10 to 11
+# just to keep the minor version number 2 digits, we had to continue
+# increasing the library minor number, so we went to 100 + minor version
+# number.  If we ever increase the major number to 12, we can go back to using
+# the minor version number for the library minor number.
+
+MAJ := 11
+$(eval MIN:=$(shell echo $$((100+$(NETPBM_MINOR_RELEASE)))))
 
 SONAME = libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ)
 
@@ -111,7 +139,7 @@ PERLPROG = print "sgi$(MAJ)." . join(":sgi$(MAJ) . ", (0..$(MIN))) . "\n"
 
 $(SONAME): \
     $(LIBOBJECTS) $(LIBOBJECTS_X) 
-	$(LD) $(LDSHLIB) -o $@ $(LIBOBJECTS) $(LIBOBJECTS_X) \
+	$(LD) $(LDSHLIB) $(LDFLAGS) -o $@ $(LIBOBJECTS) $(LIBOBJECTS_X) \
           -lc \
 	  -soname libnetpbm.$(NETPBMLIBSUFFIX) \
 	  -set_version $(shell perl -e '$(PERLPROG)') \
@@ -130,7 +158,7 @@ $(SONAME): libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ).$(MIN)
 	rm -f $@
 	$(SYMLINK) $< $@
 libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ).$(MIN): $(LIBOBJECTS) $(LIBOBJECTS_X)
-	$(LD) $(LDSHLIB) -o $@ $(LIBOBJECTS) $(LIBOBJECTS_X) \
+	$(LD) $(LDSHLIB) $(LDFLAGS) -o $@ $(LIBOBJECTS) $(LIBOBJECTS_X) \
           $(SHLIB_CLIB) -lm $(LADD)
 endif
 
@@ -140,10 +168,10 @@ $(NETPBMSHLIBPREFIX)netpbm$(DLLVER).dll: $(LIBOBJECTS) $(LIBOBJECTS_X) libnetpbm
 else
 $(NETPBMSHLIBPREFIX)netpbm$(DLLVER).dll: $(LIBOBJECTS) $(LIBOBJECTS_X)
 endif
-	$(LD) $(LDSHLIB) -Wl,--export-all-symbols \
+	$(LD) $(LDSHLIB) $(LDFLAGS) -Wl,--export-all-symbols \
             -Wl,-soname,$(NETPBMSHLIBPREFIX)netpbm$(DLLVER).dll \
 	    -Wl,--output-def,$(NETPBMSHLIBPREFIX)netpbm$(DLLVER).def \
-            -Wl,--out-implib,libnetpbm.dll.a -o $@ $(LDFLAGS) \
+            -Wl,--out-implib,libnetpbm.dll.a -o $@ \
             $(LIBOBJECTS) $(LIBOBJECTS_X) $(LDLIBS) $(LADD) 
 endif
 
@@ -157,7 +185,7 @@ libnetpbm.$(MAJ).dylib: libnetpbm.$(MAJ).$(MIN).dylib
 	$(SYMLINK) $< $@
 
 libnetpbm.$(MAJ).$(MIN).dylib: $(LIBOBJECTS) $(LIBOBJECTS_X) 
-	$(LD) $(LDSHLIB) -o $@ $(LIBOBJECTS) $(LIBOBJECTS_X) \
+	$(LD) $(LDSHLIB) $(LDFLAGS) -o $@ $(LIBOBJECTS) $(LIBOBJECTS_X) \
            -lc $(LADD)
 endif