Makefile

Tue, 21 Jan 2003 18:53:48 +0000

author
eric
date
Tue, 21 Jan 2003 18:53:48 +0000
changeset 51
3398476bbedd
parent 48
3d0be1c1c1b2
child 53
bb180150e603
permissions
-rw-r--r--

added 'dist' target, and minor cleanup

     1 # t2p: build a PDF file out of one or more TIFF Class F Group 4 files
     2 # Makefile
     3 # $Id: Makefile,v 1.11 2003/01/21 10:53:48 eric Exp $
     4 # Copyright 2001 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 CFLAGS = -Wall -g -I/usr/local/include/panda
    23 LDLIBS = -g -ltiff -lm -L/usr/local/lib/panda -lpanda -lpng
    24 YACC = bison
    25 YFLAGS = -d -v
    27 # -----------------------------------------------------------------------------
    28 # You shouldn't have to change anything below this point, but if you do please
    29 # let me know why so I can improve this Makefile.
    30 # -----------------------------------------------------------------------------
    32 VERSION = 0.1
    34 PACKAGE = t2p
    36 TARGETS = t2p bitblt_test
    38 CSRCS = t2p.c semantics.c bitblt.c bitblt_test.c
    39 OSRCS = scanner.l parser.y
    40 HDRS = t2p.h semantics.h bitblt.h 
    41 MISC = COPYING Makefile
    43 DISTFILES = $(MISC) $(HDRS) $(CSRCS) $(OSRCS)
    44 DISTNAME = $(PACKAGE)-$(VERSION)
    47 AUTO_CSRCS = scanner.c parser.tab.c
    48 AUTO_HDRS = parser.tab.h
    49 AUTO_MISC = parser.output
    52 all: $(TARGETS)
    55 dist: $(DISTFILES)
    56 	-rm -rf $(DISTNAME)
    57 	mkdir $(DISTNAME)
    58 	for f in $(DISTFILES); do ln $$f $(DISTNAME)/$$f; done
    59 	tar --gzip -chf $(DISTNAME).tar.gz $(DISTNAME)
    60 	-rm -rf $(DISTNAME)
    63 t2p: t2p.o scanner.o semantics.o parser.tab.o bitblt.o
    65 bitblt_test: bitblt_test.o bitblt.o
    68 clean:
    69 	rm -f *.o *.d $(TARGETS) $(AUTO_SRCS) $(AUTO_HDRS) $(AUTO_MISC)
    71 very_clean:
    72 	rm -f *.o *.d $(TARGETS) $(AUTO_SRCS) $(AUTO_HDRS) $(AUTO_MISC) \
    73 		*~ *.pdf
    75 wc:
    76 	wc -l $(HDRS) $(CSRCS) $(OSRCS) $(MISC)
    78 ls-lt:
    79 	ls -lt $(HDRS) $(CSRCS) $(OSRCS) $(MISC)
    82 %.tab.c %.tab.h %.output: %.y
    83 	$(YACC) $(YFLAGS) $<
    85 # %.c: %.l
    86 # 	$(LEX) $(LFLAGS) $<
    89 ALL_CSRCS = $(CSRCS) $(AUTO_CSRCS)
    91 DEPENDS = $(ALL_CSRCS:.c=.d)
    93 %.d: %.c
    94 	$(CC) -M -MG $(CFLAGS) $< | sed -e 's@ /[^ ]*@@g' -e 's@^\(.*\)\.o:@\1.d \1.o:@' > $@
    96 include $(DEPENDS)