Thu, 10 Apr 2003 08:47:30 +0000
first cut at PBM support.
1 # tumble: build a PDF file from image files
2 # Makefile
3 # $Id: Makefile,v 1.40 2003/04/10 00:47:30 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 -lpbm -lz -lm
35 ifdef DEBUG
36 CFLAGS := $(CFLAGS) -g
37 LDFLAGS := $(LDFLAGS) -g
38 else
39 CFLAGS := $(CFLAGS) -O3
40 endif
42 ifdef EFENCE
43 LDLIBS := $(LDLIBS) -lefence -lpthread
44 endif
46 ifdef STATIC
47 LDLIBS := -Wl,-static $(LDLIBS)
48 endif
51 YACC = bison
52 YFLAGS = -d -v
55 # -----------------------------------------------------------------------------
56 # You shouldn't have to change anything below this point, but if you do please
57 # let me know why so I can improve this Makefile.
58 # -----------------------------------------------------------------------------
60 VERSION = 0.33
62 PACKAGE = tumble
64 TARGETS = tumble
66 CSRCS = tumble.c semantics.c \
67 tumble_input.c tumble_tiff.c tumble_jpeg.c tumble_pbm.c \
68 bitblt.c bitblt_table_gen.c bitblt_g4.c g4_table_gen.c \
69 pdf.c pdf_util.c pdf_prim.c pdf_name_tree.c \
70 pdf_bookmark.c pdf_page_label.c \
71 pdf_text.c pdf_g4.c pdf_jpeg.c
72 OSRCS = scanner.l parser.y
73 HDRS = tumble.h tumble_input.h semantics.h bitblt.h bitblt_tables.h \
74 pdf.h pdf_private.h pdf_util.h pdf_prim.h pdf_name_tree.h
75 MISC = COPYING README INSTALL Makefile
77 DISTFILES = $(MISC) $(HDRS) $(CSRCS) $(OSRCS)
78 DISTNAME = $(PACKAGE)-$(VERSION)
80 BIN_DISTFILES = COPYING README $(TARGETS)
83 AUTO_CSRCS = scanner.c parser.tab.c bitblt_tables.c g4_tables.c
84 AUTO_HDRS = parser.tab.h bitblt_tables.h g4_tables.h
85 AUTO_MISC = parser.output
88 -include Maketest
91 all: $(TARGETS) $(TEST_TARGETS)
94 tumble: tumble.o semantics.o \
95 tumble_input.o tumble_tiff.o tumble_jpeg.o tumble_pbm.o \
96 scanner.o parser.tab.o \
97 bitblt.o bitblt_g4.o bitblt_tables.o g4_tables.o \
98 pdf.o pdf_util.o pdf_prim.o pdf_name_tree.o \
99 pdf_bookmark.o pdf_page_label.o \
100 pdf_text.o pdf_g4.o pdf_jpeg.o
101 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
102 ifndef DEBUG
103 strip $@
104 endif
107 bitblt_tables.h: bitblt_table_gen
108 ./bitblt_table_gen -h >bitblt_tables.h
110 bitblt_tables.c: bitblt_table_gen
111 ./bitblt_table_gen -c >bitblt_tables.c
113 bitblt_table_gen: bitblt_table_gen.o
115 g4_tables.h: g4_table_gen
116 ./g4_table_gen -h >g4_tables.h
118 g4_tables.c: g4_table_gen
119 ./g4_table_gen -c >g4_tables.c
121 g4_table_gen: g4_table_gen.o
124 dist: $(DISTFILES)
125 -rm -rf $(DISTNAME)
126 mkdir $(DISTNAME)
127 for f in $(DISTFILES); do ln $$f $(DISTNAME)/$$f; done
128 tar --gzip -chf $(DISTNAME).tar.gz $(DISTNAME)
129 -rm -rf $(DISTNAME)
132 rh-rel := $(shell sed 's/^Red Hat Linux release \([0-9][0-9]*\.[0-9][0-9]*\) (.*)/\1/' </etc/redhat-release)
134 bin-dist-rh: $(BIN_DISTFILES) /etc/redhat-release
135 tar --gzip -chf $(DISTNAME)-rh${rh-rel}.tar.gz $(BIN_DISTFILES)
138 clean:
139 rm -f *.o *.d $(TARGETS) $(AUTO_CSRCS) $(AUTO_HDRS) $(AUTO_MISC)
141 very_clean:
142 rm -f *.o *.d $(TARGETS) $(AUTO_CSRCS) $(AUTO_HDRS) $(AUTO_MISC) \
143 *~ *.pdf
145 wc:
146 wc -l $(HDRS) $(CSRCS) $(OSRCS) $(MISC)
148 ls-lt:
149 ls -lt $(HDRS) $(CSRCS) $(OSRCS) $(MISC)
152 %.tab.c %.tab.h %.output: %.y
153 $(YACC) $(YFLAGS) $<
156 ALL_CSRCS = $(CSRCS) $(AUTO_CSRCS) $(TEST_CSRCS)
158 DEPENDS = $(ALL_CSRCS:.c=.d)
160 %.d: %.c
161 $(CC) -M -MG $(CFLAGS) $< | sed -e 's@ /[^ ]*@@g' -e 's@^\(.*\)\.o:@\1.d \1.o:@' > $@
163 include $(DEPENDS)