File: Makefile.Linux

package info (click to toggle)
pnmtopng 2.37.1-1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 192 kB
  • ctags: 94
  • sloc: ansic: 1,687; makefile: 75; sh: 17
file content (81 lines) | stat: -rw-r--r-- 1,914 bytes parent folder | download
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
# Makefile for pnmtopng/pngtopnm
# Copyright (C) 1995-1998 Willem van Schaik

CC = gcc
CP = cp
RM = rm

# change to match your directories
#
# it is suggested that you place things like libpng and zlib in 
# version-specific directories like ../zlib-1.0 and that you make a 
# symbolic link like "ln -s zlib-1.0 zlib" in the .. directory 
#
# if the libraries and header files are already installed in /usr/lib and 
# /usr/include, just set the "INC" and "LIB" variables to empty strings and
# set the "LIB2" variables to /usr/lib/lib<whatever>.a

#PNGDIR = ../libgr2/png
PNGDIR = ../libpng
PNGINC = -I$(PNGDIR)
PNGLIB = -L$(PNGDIR) -lpng
PNGLIB2 = $(PNGDIR)/libpng.a

#PNGDIR = ../libgr2/zlib
ZDIR = ../zlib
ZINC = -I$(ZDIR)
ZLIB = -L$(ZDIR) -lz
ZLIB2 = $(ZDIR)/libz.a

#PBMDIR = /usr/local/netpbm
#PBMDIR = ../libgr2
PBMDIR = ../netpbm
PBMINC = -I$(PBMDIR)/pnm -I$(PBMDIR)/ppm -I$(PBMDIR)/pgm -I$(PBMDIR)/pbm
PBMLIB = -L$(PBMDIR)/pnm -L$(PBMDIR)/ppm -L$(PBMDIR)/pgm -L$(PBMDIR)/pbm \
	 -lnetpbm
PBMLIB2 = -l/usr/lib/libnetpbm.a
#$(PBMDIR)/pnm/libpnm.a $(PBMDIR)/ppm/libppm.a \
#	  $(PBMDIR)/pgm/libpgm.a $(PBMDIR)/pbm/libpbm.a


# where "make install" puts pnmtopng and pngtopnm

#INSTDIR = $(PBMDIR)/pnm
INSTDIR = $(DESTDIR)/usr


CFLAGS = -O3 -Wall -D_BSD_SOURCE $(PNGINC) $(ZINC) $(PBMINC)
LDFLAGS = $(PNGLIB) $(ZLIB) $(PBMLIB) -lm
LDFLAGS2 = $(PNGLIB2) $(ZLIB2) $(PBMLIB2) -lm

MANS = pnmtopng.1 pngtopnm.1
SRCS = pnmtopng.c pngtopnm.c
OBJS = pnmtopng.o pngtopnm.o
EXES = pnmtopng pngtopnm


# dependency rules

all: $(EXES)

pnmtopng: pnmtopng.o
	$(CC) -o $@ pnmtopng.o $(LDFLAGS)

pngtopnm: pngtopnm.o
	$(CC) -o $@ pngtopnm.o $(LDFLAGS)

pnmtopng-static: pnmtopng.o
	$(CC) -o $@ pnmtopng.o $(LDFLAGS2)

pngtopnm-static: pngtopnm.o
	$(CC) -o $@ pngtopnm.o $(LDFLAGS2)

install: all
	$(CP) $(EXES) $(INSTDIR)/bin
	$(CP) $(MANS) $(INSTDIR)/man/man1

clean:
	$(RM) -f $(OBJS) $(EXES)


# end of Makefile.Linux