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

     1 # tumble: build a PDF file from image files
     2 # Makefile
     3 # $Id: Makefile,v 1.41 2003/04/10 01:02:12 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
    29 CTL_LANG=1
    32 CFLAGS = -Wall
    33 LDFLAGS =
    34 LDLIBS = -ltiff -ljpeg -lpbm -lz -lm
    36 ifdef DEBUG
    37 CFLAGS := $(CFLAGS) -g
    38 LDFLAGS := $(LDFLAGS) -g
    39 else
    40 CFLAGS := $(CFLAGS) -O3
    41 endif
    43 ifdef EFENCE
    44 LDLIBS := $(LDLIBS) -lefence -lpthread
    45 endif
    47 ifdef STATIC
    48 LDLIBS := -Wl,-static $(LDLIBS)
    49 endif
    52 YACC = bison
    53 YFLAGS = -d -v
    56 # -----------------------------------------------------------------------------
    57 # You shouldn't have to change anything below this point, but if you do please
    58 # let me know why so I can improve this Makefile.
    59 # -----------------------------------------------------------------------------
    61 VERSION = 0.33-philpem1
    63 PACKAGE = tumble
    65 TARGETS = tumble
    67 CSRCS = tumble.c semantics.c \
    68 	tumble_input.c tumble_tiff.c tumble_jpeg.c \
    69 	tumble_pbm.c tumble_png.c tumble_jp2.c \
    70 	bitblt.c bitblt_table_gen.c bitblt_g4.c g4_table_gen.c \
    71 	pdf.c pdf_util.c pdf_prim.c pdf_name_tree.c \
    72 	pdf_bookmark.c pdf_page_label.c \
    73 	pdf_text.c pdf_g4.c pdf_jpeg.c pdf_png.c pdf_jp2.c
    74 OSRCS = scanner.l parser.y
    75 HDRS = tumble.h tumble_input.h semantics.h bitblt.h bitblt_tables.h \
    76 	pdf.h pdf_private.h pdf_util.h pdf_prim.h pdf_name_tree.h
    77 MISC = COPYING README INSTALL Makefile
    79 DISTFILES = $(MISC) $(HDRS) $(CSRCS) $(OSRCS)
    80 DISTNAME = $(PACKAGE)-$(VERSION)
    82 BIN_DISTFILES = COPYING README $(TARGETS)
    85 AUTO_CSRCS = bitblt_tables.c g4_tables.c
    86 AUTO_HDRS = bitblt_tables.h g4_tables.h
    88 ifdef CTL_LANG
    89 AUTO_CSRCS += scanner.c parser.tab.c
    90 AUTO_HDRS += parser_tab.h
    91 AUTO_MISC = parser.output
    92 endif
    95 CDEFINES = -DTUMBLE_VERSION=$(VERSION)
    97 ifdef CTL_LANG
    98 CDEFINES += -DCTL_LANG
    99 endif
   101 CFLAGS := $(CFLAGS) $(CDEFINES)
   104 -include Maketest
   107 all: $(TARGETS) $(TEST_TARGETS)
   110 TUMBLE_OBJS = tumble.o semantics.o \
   111 		tumble_input.o tumble_tiff.o tumble_jpeg.o \
   112 		tumble_pbm.o tumble_png.o tumble_jp2.o \
   113 		bitblt.o bitblt_g4.o bitblt_tables.o g4_tables.o \
   114 		pdf.o pdf_util.o pdf_prim.o pdf_name_tree.o \
   115 		pdf_bookmark.o pdf_page_label.o \
   116 		pdf_text.o pdf_g4.o pdf_jpeg.o pdf_png.o pdf_jp2.o
   118 ifdef CTL_LANG
   119 TUMBLE_OBJS += scanner.o parser.tab.o
   120 endif
   122 tumble: $(TUMBLE_OBJS)
   123 	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
   124 ifndef DEBUG
   125 	strip $@
   126 endif
   129 bitblt_tables.h: bitblt_table_gen
   130 	./bitblt_table_gen -h >bitblt_tables.h
   132 bitblt_tables.c: bitblt_table_gen
   133 	./bitblt_table_gen -c >bitblt_tables.c
   135 bitblt_table_gen: bitblt_table_gen.o
   137 g4_tables.h: g4_table_gen
   138 	./g4_table_gen -h >g4_tables.h
   140 g4_tables.c: g4_table_gen
   141 	./g4_table_gen -c >g4_tables.c
   143 g4_table_gen: g4_table_gen.o
   146 dist: $(DISTFILES)
   147 	-rm -rf $(DISTNAME)
   148 	mkdir $(DISTNAME)
   149 	for f in $(DISTFILES); do ln $$f $(DISTNAME)/$$f; done
   150 	tar --gzip -chf $(DISTNAME).tar.gz $(DISTNAME)
   151 	-rm -rf $(DISTNAME)
   154 bin-dist-rh: $(BIN_DISTFILES) /etc/redhat-release
   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)
   157 bin-dist-fc: $(BIN_DISTFILES) /etc/fedora-release
   158 	tar --gzip -chf $(DISTNAME)-fc$(shell sed 's/^Fedora Core release \([0-9][0-9.]*\) (.*)/\1/' </etc/fedora-release).tar.gz $(BIN_DISTFILES)
   160 clean:
   161 	rm -f *.o *.d $(TARGETS) $(AUTO_CSRCS) $(AUTO_HDRS) $(AUTO_MISC)
   163 very_clean:
   164 	rm -f *.o *.d $(TARGETS) $(AUTO_CSRCS) $(AUTO_HDRS) $(AUTO_MISC) \
   165 		*~ *.pdf
   167 wc:
   168 	wc -l $(HDRS) $(CSRCS) $(OSRCS) $(MISC)
   170 ls-lt:
   171 	ls -lt $(HDRS) $(CSRCS) $(OSRCS) $(MISC)
   174 %.tab.c %.tab.h %.output: %.y
   175 	$(YACC) $(YFLAGS) $<
   178 ALL_CSRCS = $(CSRCS) $(AUTO_CSRCS) $(TEST_CSRCS)
   180 DEPENDS = $(ALL_CSRCS:.c=.d)
   182 %.d: %.c
   183 	$(CC) -M -MG $(CFLAGS) $< | sed -e 's@ /[^ ]*@@g' -e 's@^\(.*\)\.o:@\1.d \1.o:@' > $@
   185 include $(DEPENDS)