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
|
--- ppm/Makefile.orig Tue Apr 4 04:53:40 2000
+++ ppm/Makefile Sat Apr 8 12:00:00 2000
@@ -19,8 +19,15 @@
endif
NETPBMLIBS = $(LIBPPM) $(PBMDIR)/$(LIBPBM) $(PGMDIR)/$(LIBPGM)
+NETPBMLD = -L. -lppm -L$(PBMDIR) -lpbm -L$(PGMDIR) -lpgm
LIBLIBS = $(PBMDIR)/$(LIBPBM) $(PGMDIR)/$(LIBPGM)
+ifeq ($(JPEGLIB_DIR),NONE)
+ JPEGLD =
+else
+ JPEGLD = -L$(JPEGLIB_DIR) -ljpeg
+endif
+
PORTBINARIES = bmptoppm eyuvtoppm gouldtoppm hpcdtoppm ilbmtoppm imgtoppm \
mtvtoppm pcxtoppm pgmtoppm pi1toppm picttoppm \
pjtoppm \
@@ -40,6 +47,7 @@
# We don't build vidtoppm by default, because it requires special libraries
# and there is no known requirement for vidtoppm.
+NOMERGEBINARIES =
ifneq ($(JPEGLIB_DIR), NONE)
ifneq ($(JPEGHDR_DIR), NONE)
NOMERGEBINARIES += ppmtojpeg
@@ -55,6 +63,7 @@
MERGE_OBJECTS = $(patsubst %,%.o2, $(PORTBINARIES) $(MATHBINARIES))
LIBOBJECTS = libppm1.o libppm2.o libppm3.o libppm4.o libppm5.o bitio.o
+LIBSOBJECTS = libppm1.so libppm2.so libppm3.so libppm4.so libppm5.so bitio.so
MANUALS1 = $(BINARIES) $(SCRIPTS)
MANUALS3 = libppm
@@ -62,7 +71,7 @@
MERGENAME= ppmmerge
-INTERFACE_HEADERS = ppm.h
+INTERFACE_HEADERS = ppm.h ppmcmap.h ppmdraw.h
.PHONY: all
all: $(BINARIES)
@@ -72,29 +81,31 @@
# Rules for plain programs.
$(PORTBINARIES): %: %.o $(NETPBMLIBS)
- $(LD) $(LDFLAGS) -o $@ $@.o $(NETPBMLIBS) \
- $(CDEBUG)
+ $(LD) $(LDFLAGS) -o $@ $@.o $(NETPBMLD) $(CDEBUG)
# Rule for math-dependent programs.
$(MATHBINARIES): %: %.o $(NETPBMLIBS)
- $(LD) $(LDFLAGS) -o $@ $@.o -lm $(NETPBMLIBS) $(CDEBUG)
+ $(LD) $(LDFLAGS) -o $@ $@.o -lm $(NETPBMLD) $(CDEBUG)
-ppmtojpeg: %: %.o $(NETPBMLIBS)
- $(LD) $(LDFLAGS) -o $@ $@.o $(NETPBMLIBS) \
- -L $(JPEGLIB_DIR) -ljpeg $(CDEBUG)
+ppmtojpeg: %: %.o $(NETPBMLIBS) ../shhopt/libshhopt.a
+ $(LD) $(LDFLAGS) -o $@ $@.o $(NETPBMLD) ../shhopt/libshhopt.a \
+ $(JPEGLD) $(CDEBUG)
# Rule for objects.
$(OBJECTS) $(LIBOBJECTS): %.o: %.c
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
+$(LIBSOBJECTS): %.so: %.c
+ $(CC) -c -fpic -DPIC $(CFLAGS) $(INCLUDE) -o $@ $<
+
$(MERGE_OBJECTS): %.o2: %.c
$(CC) -c $(CFLAGS) $(INCLUDE) "-Dmain=$*_main" -o $@ $<
# And libraries.
$(PBMDIR)/$(LIBPBM): FORCE
- cd $(PBMDIR) ; make $(LIBPBM)
+ cd $(PBMDIR) ; $(MAKE) $(LIBPBM)
$(PGMDIR)/$(LIBPGM): FORCE
- cd $(PGMDIR) ; make $(LIBPGM)
+ cd $(PGMDIR) ; $(MAKE) $(LIBPGM)
.PHONY: install.bin
install.bin: install.bin.common
|