Makefile

Mon, 14 Dec 2009 16:18:21 +0000

author
Philip Pemberton <philpem@philpem.me.uk>
date
Mon, 14 Dec 2009 16:18:21 +0000
changeset 172
2fae6df568f6
parent 170
e375cda0342e
permissions
-rw-r--r--

remove erroneous 0.33-philpem1 tag

eric@125 1 # tumble: build a PDF file from image files
eric@1 2 # Makefile
eric@158 3 # $Id: Makefile,v 1.41 2003/04/10 01:02:12 eric Exp $
eric@80 4 # Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
eric@1 5 #
eric@1 6 # This program is free software; you can redistribute it and/or modify
eric@1 7 # it under the terms of the GNU General Public License version 2 as
eric@1 8 # published by the Free Software Foundation. Note that permission is
eric@1 9 # not granted to redistribute this program under the terms of any
eric@1 10 # other version of the General Public License.
eric@1 11 #
eric@1 12 # This program is distributed in the hope that it will be useful,
eric@1 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
eric@1 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
eric@1 15 # GNU General Public License for more details.
eric@1 16 #
eric@1 17 # You should have received a copy of the GNU General Public License
eric@1 18 # along with this program; if not, write to the Free Software
eric@1 19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
eric@1 20
eric@1 21
eric@90 22 # Conditionals: uncomment the following defines as nessary. Note that a
eric@90 23 # "0" value is considered true by make, so to disable conditionals comment
eric@90 24 # them out or set them to a null string.
eric@86 25
eric@143 26 #DEBUG=1
eric@90 27 #EFENCE=1
eric@90 28 #STATIC=1
eric@160 29 CTL_LANG=1
eric@86 30
eric@86 31
eric@86 32 CFLAGS = -Wall
eric@86 33 LDFLAGS =
eric@157 34 LDLIBS = -ltiff -ljpeg -lpbm -lz -lm
eric@53 35
eric@86 36 ifdef DEBUG
eric@86 37 CFLAGS := $(CFLAGS) -g
eric@86 38 LDFLAGS := $(LDFLAGS) -g
eric@136 39 else
eric@136 40 CFLAGS := $(CFLAGS) -O3
eric@90 41 endif
eric@90 42
eric@90 43 ifdef EFENCE
eric@86 44 LDLIBS := $(LDLIBS) -lefence -lpthread
eric@86 45 endif
eric@53 46
eric@86 47 ifdef STATIC
eric@86 48 LDLIBS := -Wl,-static $(LDLIBS)
eric@86 49 endif
eric@86 50
eric@53 51
eric@6 52 YACC = bison
eric@6 53 YFLAGS = -d -v
eric@6 54
eric@53 55
eric@51 56 # -----------------------------------------------------------------------------
eric@51 57 # You shouldn't have to change anything below this point, but if you do please
eric@51 58 # let me know why so I can improve this Makefile.
eric@51 59 # -----------------------------------------------------------------------------
eric@51 60
philpem@170 61 VERSION = 0.33-philpem1
eric@51 62
eric@125 63 PACKAGE = tumble
eric@12 64
eric@125 65 TARGETS = tumble
eric@15 66
eric@125 67 CSRCS = tumble.c semantics.c \
philpem@166 68 tumble_input.c tumble_tiff.c tumble_jpeg.c \
philpem@166 69 tumble_pbm.c tumble_png.c tumble_jp2.c \
eric@91 70 bitblt.c bitblt_table_gen.c bitblt_g4.c g4_table_gen.c \
eric@131 71 pdf.c pdf_util.c pdf_prim.c pdf_name_tree.c \
eric@131 72 pdf_bookmark.c pdf_page_label.c \
philpem@166 73 pdf_text.c pdf_g4.c pdf_jpeg.c pdf_png.c pdf_jp2.c
eric@51 74 OSRCS = scanner.l parser.y
eric@141 75 HDRS = tumble.h tumble_input.h semantics.h bitblt.h bitblt_tables.h \
eric@80 76 pdf.h pdf_private.h pdf_util.h pdf_prim.h pdf_name_tree.h
eric@136 77 MISC = COPYING README INSTALL Makefile
eric@51 78
eric@51 79 DISTFILES = $(MISC) $(HDRS) $(CSRCS) $(OSRCS)
eric@51 80 DISTNAME = $(PACKAGE)-$(VERSION)
eric@51 81
eric@138 82 BIN_DISTFILES = COPYING README $(TARGETS)
eric@138 83
eric@51 84
eric@160 85 AUTO_CSRCS = bitblt_tables.c g4_tables.c
eric@160 86 AUTO_HDRS = bitblt_tables.h g4_tables.h
eric@160 87
eric@160 88 ifdef CTL_LANG
eric@160 89 AUTO_CSRCS += scanner.c parser.tab.c
eric@160 90 AUTO_HDRS += parser_tab.h
eric@99 91 AUTO_MISC = parser.output
eric@160 92 endif
eric@15 93
eric@51 94
eric@160 95 CDEFINES = -DTUMBLE_VERSION=$(VERSION)
eric@160 96
eric@160 97 ifdef CTL_LANG
eric@160 98 CDEFINES += -DCTL_LANG
eric@160 99 endif
eric@160 100
eric@160 101 CFLAGS := $(CFLAGS) $(CDEFINES)
eric@158 102
eric@158 103
eric@90 104 -include Maketest
eric@90 105
eric@90 106
eric@90 107 all: $(TARGETS) $(TEST_TARGETS)
eric@51 108
eric@51 109
eric@160 110 TUMBLE_OBJS = tumble.o semantics.o \
philpem@166 111 tumble_input.o tumble_tiff.o tumble_jpeg.o \
philpem@166 112 tumble_pbm.o tumble_png.o tumble_jp2.o \
eric@99 113 bitblt.o bitblt_g4.o bitblt_tables.o g4_tables.o \
eric@131 114 pdf.o pdf_util.o pdf_prim.o pdf_name_tree.o \
eric@131 115 pdf_bookmark.o pdf_page_label.o \
philpem@166 116 pdf_text.o pdf_g4.o pdf_jpeg.o pdf_png.o pdf_jp2.o
eric@160 117
eric@160 118 ifdef CTL_LANG
eric@160 119 TUMBLE_OBJS += scanner.o parser.tab.o
eric@160 120 endif
eric@160 121
eric@160 122 tumble: $(TUMBLE_OBJS)
eric@86 123 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
eric@86 124 ifndef DEBUG
eric@86 125 strip $@
eric@86 126 endif
eric@86 127
eric@53 128
eric@53 129 bitblt_tables.h: bitblt_table_gen
eric@97 130 ./bitblt_table_gen -h >bitblt_tables.h
eric@97 131
eric@97 132 bitblt_tables.c: bitblt_table_gen
eric@97 133 ./bitblt_table_gen -c >bitblt_tables.c
eric@53 134
eric@53 135 bitblt_table_gen: bitblt_table_gen.o
eric@53 136
eric@91 137 g4_tables.h: g4_table_gen
eric@99 138 ./g4_table_gen -h >g4_tables.h
eric@99 139
eric@99 140 g4_tables.c: g4_table_gen
eric@99 141 ./g4_table_gen -c >g4_tables.c
eric@71 142
eric@91 143 g4_table_gen: g4_table_gen.o
eric@71 144
eric@53 145
eric@51 146 dist: $(DISTFILES)
eric@51 147 -rm -rf $(DISTNAME)
eric@51 148 mkdir $(DISTNAME)
eric@51 149 for f in $(DISTFILES); do ln $$f $(DISTNAME)/$$f; done
eric@51 150 tar --gzip -chf $(DISTNAME).tar.gz $(DISTNAME)
eric@51 151 -rm -rf $(DISTNAME)
eric@51 152
eric@51 153
eric@161 154 bin-dist-rh: $(BIN_DISTFILES) /etc/redhat-release
eric@163 155 tar --gzip -chf $(DISTNAME)-rh$(shell sed 's/^Red Hat Linux release \([0-9][0-9.]*\) (.*)/\1/' </etc/redhat-release).tar.gz $(BIN_DISTFILES)
eric@126 156
eric@161 157 bin-dist-fc: $(BIN_DISTFILES) /etc/fedora-release
eric@161 158 tar --gzip -chf $(DISTNAME)-fc$(shell sed 's/^Fedora Core release \([0-9][0-9.]*\) (.*)/\1/' </etc/fedora-release).tar.gz $(BIN_DISTFILES)
eric@126 159
eric@15 160 clean:
eric@53 161 rm -f *.o *.d $(TARGETS) $(AUTO_CSRCS) $(AUTO_HDRS) $(AUTO_MISC)
eric@44 162
eric@44 163 very_clean:
eric@53 164 rm -f *.o *.d $(TARGETS) $(AUTO_CSRCS) $(AUTO_HDRS) $(AUTO_MISC) \
eric@44 165 *~ *.pdf
eric@15 166
eric@20 167 wc:
eric@51 168 wc -l $(HDRS) $(CSRCS) $(OSRCS) $(MISC)
eric@20 169
eric@20 170 ls-lt:
eric@51 171 ls -lt $(HDRS) $(CSRCS) $(OSRCS) $(MISC)
eric@20 172
eric@15 173
eric@15 174 %.tab.c %.tab.h %.output: %.y
eric@6 175 $(YACC) $(YFLAGS) $<
eric@6 176
eric@15 177
eric@90 178 ALL_CSRCS = $(CSRCS) $(AUTO_CSRCS) $(TEST_CSRCS)
eric@15 179
eric@51 180 DEPENDS = $(ALL_CSRCS:.c=.d)
eric@15 181
eric@15 182 %.d: %.c
eric@15 183 $(CC) -M -MG $(CFLAGS) $< | sed -e 's@ /[^ ]*@@g' -e 's@^\(.*\)\.o:@\1.d \1.o:@' > $@
eric@15 184
eric@15 185 include $(DEPENDS)