Sat, 08 Mar 2003 10:02:13 +0000
added separate conditional for Electric Fence (EFENCE). moved test programs into Maketest.
1 # t2p: build a PDF file out of one or more TIFF Class F Group 4 files
2 # Makefile
3 # $Id: Makefile,v 1.20 2003/03/08 02:02:13 eric Exp $
4 # Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License version 2 as
8 # published by the Free Software Foundation. Note that permission is
9 # not granted to redistribute this program under the terms of any
10 # other version of the General Public License.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
22 # Conditionals: uncomment the following defines as nessary. Note that a
23 # "0" value is considered true by make, so to disable conditionals comment
24 # them out or set them to a null string.
26 #DEBUG=1
27 #EFENCE=1
28 #STATIC=1
31 CFLAGS = -Wall
32 LDFLAGS =
33 LDLIBS = -ltiff -ljpeg -lz -lm
35 ifdef DEBUG
36 CFLAGS := $(CFLAGS) -g
37 LDFLAGS := $(LDFLAGS) -g
38 endif
40 ifdef EFENCE
41 LDLIBS := $(LDLIBS) -lefence -lpthread
42 endif
44 ifdef STATIC
45 LDLIBS := -Wl,-static $(LDLIBS)
46 endif
49 YACC = bison
50 YFLAGS = -d -v
53 # -----------------------------------------------------------------------------
54 # You shouldn't have to change anything below this point, but if you do please
55 # let me know why so I can improve this Makefile.
56 # -----------------------------------------------------------------------------
58 VERSION = 0.11
60 PACKAGE = t2p
62 TARGETS = t2p
64 CSRCS = t2p.c semantics.c \
65 bitblt.c bitblt_table_gen.c \
66 pdf_g4.c pdf_g4_table_gen.c \
67 pdf.c pdf_util.c pdf_prim.c pdf_bookmark.c pdf_name_tree.c
68 OSRCS = scanner.l parser.y
69 HDRS = t2p.h semantics.h bitblt.h \
70 pdf.h pdf_private.h pdf_util.h pdf_prim.h pdf_name_tree.h
71 MISC = COPYING Makefile
73 DISTFILES = $(MISC) $(HDRS) $(CSRCS) $(OSRCS)
74 DISTNAME = $(PACKAGE)-$(VERSION)
77 AUTO_CSRCS = scanner.c parser.tab.c
78 AUTO_HDRS = parser.tab.h bitblt_tables.h pdf_g4_tables.h
79 AUTO_MISC = parser.output
82 -include Maketest
85 all: $(TARGETS) $(TEST_TARGETS)
88 t2p: t2p.o scanner.o semantics.o parser.tab.o bitblt.o \
89 pdf_g4.o \
90 pdf.o pdf_util.o pdf_prim.o pdf_bookmark.o pdf_name_tree.o
91 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
92 ifndef DEBUG
93 strip $@
94 endif
97 bitblt_tables.h: bitblt_table_gen
98 ./bitblt_table_gen >bitblt_tables.h
100 bitblt_table_gen: bitblt_table_gen.o
102 pdf_g4_tables.h: pdf_g4_table_gen
103 ./pdf_g4_table_gen >pdf_g4_tables.h
105 pdf_g4_table_gen: pdf_g4_table_gen.o
108 dist: $(DISTFILES)
109 -rm -rf $(DISTNAME)
110 mkdir $(DISTNAME)
111 for f in $(DISTFILES); do ln $$f $(DISTNAME)/$$f; done
112 tar --gzip -chf $(DISTNAME).tar.gz $(DISTNAME)
113 -rm -rf $(DISTNAME)
116 clean:
117 rm -f *.o *.d $(TARGETS) $(AUTO_CSRCS) $(AUTO_HDRS) $(AUTO_MISC)
119 very_clean:
120 rm -f *.o *.d $(TARGETS) $(AUTO_CSRCS) $(AUTO_HDRS) $(AUTO_MISC) \
121 *~ *.pdf
123 wc:
124 wc -l $(HDRS) $(CSRCS) $(OSRCS) $(MISC)
126 ls-lt:
127 ls -lt $(HDRS) $(CSRCS) $(OSRCS) $(MISC)
130 %.tab.c %.tab.h %.output: %.y
131 $(YACC) $(YFLAGS) $<
134 ALL_CSRCS = $(CSRCS) $(AUTO_CSRCS) $(TEST_CSRCS)
136 DEPENDS = $(ALL_CSRCS:.c=.d)
138 %.d: %.c
139 $(CC) -M -MG $(CFLAGS) $< | sed -e 's@ /[^ ]*@@g' -e 's@^\(.*\)\.o:@\1.d \1.o:@' > $@
141 include $(DEPENDS)