Makefile

Fri, 14 Mar 2003 08:56:38 +0000

author
eric
date
Fri, 14 Mar 2003 08:56:38 +0000
changeset 132
ccf1c28a2940
parent 131
4b8c80d77f76
child 136
82d6f19753d6
permissions
-rw-r--r--

remove debug output.

     1 # tumble: build a PDF file from image files
     2 # Makefile
     3 # $Id: Makefile,v 1.32 2003/03/14 00:24:37 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.27
    60 PACKAGE = tumble
    62 TARGETS = tumble
    64 CSRCS = tumble.c semantics.c \
    65 	bitblt.c bitblt_table_gen.c bitblt_g4.c g4_table_gen.c \
    66 	pdf.c pdf_util.c pdf_prim.c pdf_name_tree.c \
    67 	pdf_bookmark.c pdf_page_label.c \
    68 	pdf_text.c pdf_g4.c pdf_jpeg.c
    69 OSRCS = scanner.l parser.y
    70 HDRS = tumble.h semantics.h bitblt.h bitblt_tables.h \
    71 	pdf.h pdf_private.h pdf_util.h pdf_prim.h pdf_name_tree.h
    72 MISC = COPYING Makefile
    74 DISTFILES = $(MISC) $(HDRS) $(CSRCS) $(OSRCS)
    75 DISTNAME = $(PACKAGE)-$(VERSION)
    78 AUTO_CSRCS = scanner.c parser.tab.c bitblt_tables.c g4_tables.c
    79 AUTO_HDRS = parser.tab.h  bitblt_tables.h g4_tables.h
    80 AUTO_MISC = parser.output
    83 -include Maketest
    86 all: $(TARGETS) $(TEST_TARGETS)
    89 tumble: tumble.o scanner.o semantics.o parser.tab.o \
    90 		bitblt.o bitblt_g4.o bitblt_tables.o g4_tables.o \
    91 		pdf.o pdf_util.o pdf_prim.o pdf_name_tree.o \
    92 		pdf_bookmark.o pdf_page_label.o \
    93 		pdf_text.o pdf_g4.o pdf_jpeg.o
    94 	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
    95 ifndef DEBUG
    96 	strip $@
    97 endif
   100 bitblt_tables.h: bitblt_table_gen
   101 	./bitblt_table_gen -h >bitblt_tables.h
   103 bitblt_tables.c: bitblt_table_gen
   104 	./bitblt_table_gen -c >bitblt_tables.c
   106 bitblt_table_gen: bitblt_table_gen.o
   108 g4_tables.h: g4_table_gen
   109 	./g4_table_gen -h >g4_tables.h
   111 g4_tables.c: g4_table_gen
   112 	./g4_table_gen -c >g4_tables.c
   114 g4_table_gen: g4_table_gen.o
   117 dist: $(DISTFILES)
   118 	-rm -rf $(DISTNAME)
   119 	mkdir $(DISTNAME)
   120 	for f in $(DISTFILES); do ln $$f $(DISTNAME)/$$f; done
   121 	tar --gzip -chf $(DISTNAME).tar.gz $(DISTNAME)
   122 	-rm -rf $(DISTNAME)
   125 rh-rel := $(shell sed 's/^Red Hat Linux release \([0-9][0-9]*\.[0-9][0-9]*\) (.*)/\1/' </etc/redhat-release)
   127 bin-dist-rh: COPYING $(TARGETS) /etc/redhat-release
   128 	tar --gzip -chf $(DISTNAME)-rh${rh-rel}.tar.gz COPYING $(TARGETS)
   131 clean:
   132 	rm -f *.o *.d $(TARGETS) $(AUTO_CSRCS) $(AUTO_HDRS) $(AUTO_MISC)
   134 very_clean:
   135 	rm -f *.o *.d $(TARGETS) $(AUTO_CSRCS) $(AUTO_HDRS) $(AUTO_MISC) \
   136 		*~ *.pdf
   138 wc:
   139 	wc -l $(HDRS) $(CSRCS) $(OSRCS) $(MISC)
   141 ls-lt:
   142 	ls -lt $(HDRS) $(CSRCS) $(OSRCS) $(MISC)
   145 %.tab.c %.tab.h %.output: %.y
   146 	$(YACC) $(YFLAGS) $<
   149 ALL_CSRCS = $(CSRCS) $(AUTO_CSRCS) $(TEST_CSRCS)
   151 DEPENDS = $(ALL_CSRCS:.c=.d)
   153 %.d: %.c
   154 	$(CC) -M -MG $(CFLAGS) $< | sed -e 's@ /[^ ]*@@g' -e 's@^\(.*\)\.o:@\1.d \1.o:@' > $@
   156 include $(DEPENDS)