Makefile

Sat, 08 Mar 2003 07:23:49 +0000

author
eric
date
Sat, 08 Mar 2003 07:23:49 +0000
changeset 86
7de78f7789ef
parent 80
96c64a7566df
child 90
4830f4d7ba7a
permissions
-rw-r--r--

added conditionals for debug builds and static linking.

eric@44 1 # t2p: build a PDF file out of one or more TIFF Class F Group 4 files
eric@1 2 # Makefile
eric@86 3 # $Id: Makefile,v 1.19 2003/03/07 23:23:49 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@86 22
eric@86 23 DEBUG=1
eric@86 24 # STATIC=1
eric@86 25
eric@86 26
eric@86 27 CFLAGS = -Wall
eric@86 28 LDFLAGS =
eric@86 29 LDLIBS = -ltiff -ljpeg -lz -lm
eric@53 30
eric@86 31 ifdef DEBUG
eric@86 32 CFLAGS := $(CFLAGS) -g
eric@86 33 LDFLAGS := $(LDFLAGS) -g
eric@86 34 LDLIBS := $(LDLIBS) -lefence -lpthread
eric@86 35 endif
eric@53 36
eric@86 37 ifdef STATIC
eric@86 38 LDLIBS := -Wl,-static $(LDLIBS)
eric@86 39 endif
eric@86 40
eric@53 41
eric@6 42 YACC = bison
eric@6 43 YFLAGS = -d -v
eric@6 44
eric@53 45
eric@51 46 # -----------------------------------------------------------------------------
eric@51 47 # You shouldn't have to change anything below this point, but if you do please
eric@51 48 # let me know why so I can improve this Makefile.
eric@51 49 # -----------------------------------------------------------------------------
eric@51 50
eric@86 51 VERSION = 0.11
eric@51 52
eric@51 53 PACKAGE = t2p
eric@12 54
eric@44 55 TARGETS = t2p bitblt_test
eric@15 56
eric@80 57 CSRCS = t2p.c semantics.c \
eric@80 58 bitblt.c bitblt_test.c bitblt_table_gen.c \
eric@80 59 pdf_g4.c pdf_g4_table_gen.c \
eric@80 60 pdf.c pdf_util.c pdf_prim.c pdf_bookmark.c pdf_name_tree.c
eric@51 61 OSRCS = scanner.l parser.y
eric@70 62 HDRS = t2p.h semantics.h bitblt.h \
eric@80 63 pdf.h pdf_private.h pdf_util.h pdf_prim.h pdf_name_tree.h
eric@51 64 MISC = COPYING Makefile
eric@51 65
eric@51 66 DISTFILES = $(MISC) $(HDRS) $(CSRCS) $(OSRCS)
eric@51 67 DISTNAME = $(PACKAGE)-$(VERSION)
eric@51 68
eric@51 69
eric@51 70 AUTO_CSRCS = scanner.c parser.tab.c
eric@71 71 AUTO_HDRS = parser.tab.h bitblt_tables.h pdf_g4_tables.h
eric@15 72 AUTO_MISC = parser.output
eric@15 73
eric@51 74
eric@51 75 all: $(TARGETS)
eric@51 76
eric@51 77
eric@61 78 t2p: t2p.o scanner.o semantics.o parser.tab.o bitblt.o \
eric@86 79 pdf_g4.o \
eric@86 80 pdf.o pdf_util.o pdf_prim.o pdf_bookmark.o pdf_name_tree.o
eric@86 81 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
eric@86 82 ifndef DEBUG
eric@86 83 strip $@
eric@86 84 endif
eric@86 85
eric@53 86
eric@53 87 bitblt_tables.h: bitblt_table_gen
eric@53 88 ./bitblt_table_gen >bitblt_tables.h
eric@53 89
eric@53 90 bitblt_table_gen: bitblt_table_gen.o
eric@53 91
eric@53 92 bitblt_test: bitblt_test.o bitblt.o
eric@53 93
eric@71 94 pdf_g4_tables.h: pdf_g4_table_gen
eric@71 95 ./pdf_g4_table_gen >pdf_g4_tables.h
eric@71 96
eric@71 97 pdf_g4_table_gen: pdf_g4_table_gen.o
eric@71 98
eric@53 99
eric@51 100 dist: $(DISTFILES)
eric@51 101 -rm -rf $(DISTNAME)
eric@51 102 mkdir $(DISTNAME)
eric@51 103 for f in $(DISTFILES); do ln $$f $(DISTNAME)/$$f; done
eric@51 104 tar --gzip -chf $(DISTNAME).tar.gz $(DISTNAME)
eric@51 105 -rm -rf $(DISTNAME)
eric@51 106
eric@51 107
eric@15 108 clean:
eric@53 109 rm -f *.o *.d $(TARGETS) $(AUTO_CSRCS) $(AUTO_HDRS) $(AUTO_MISC)
eric@44 110
eric@44 111 very_clean:
eric@53 112 rm -f *.o *.d $(TARGETS) $(AUTO_CSRCS) $(AUTO_HDRS) $(AUTO_MISC) \
eric@44 113 *~ *.pdf
eric@15 114
eric@20 115 wc:
eric@51 116 wc -l $(HDRS) $(CSRCS) $(OSRCS) $(MISC)
eric@20 117
eric@20 118 ls-lt:
eric@51 119 ls -lt $(HDRS) $(CSRCS) $(OSRCS) $(MISC)
eric@20 120
eric@15 121
eric@15 122 %.tab.c %.tab.h %.output: %.y
eric@6 123 $(YACC) $(YFLAGS) $<
eric@6 124
eric@15 125
eric@51 126 ALL_CSRCS = $(CSRCS) $(AUTO_CSRCS)
eric@15 127
eric@51 128 DEPENDS = $(ALL_CSRCS:.c=.d)
eric@15 129
eric@15 130 %.d: %.c
eric@15 131 $(CC) -M -MG $(CFLAGS) $< | sed -e 's@ /[^ ]*@@g' -e 's@^\(.*\)\.o:@\1.d \1.o:@' > $@
eric@15 132
eric@15 133 include $(DEPENDS)