Makefile

changeset 15
dda3d673b82b
parent 12
c3e2c2344560
child 20
a1cd8cb9d09e
     1.1 --- a/Makefile	Sun Dec 30 04:16:46 2001 +0000
     1.2 +++ b/Makefile	Sun Dec 30 04:16:46 2001 +0000
     1.3 @@ -1,6 +1,6 @@
     1.4  # tiff2pdf: build a PDF file out of one or more TIFF Class F Group 4 files
     1.5  # Makefile
     1.6 -# $Id: Makefile,v 1.5 2001/12/29 10:59:17 eric Exp $
     1.7 +# $Id: Makefile,v 1.6 2001/12/29 20:16:46 eric Exp $
     1.8  # Copyright 2001 Eric Smith <eric@brouhaha.com>
     1.9  #
    1.10  # This program is free software; you can redistribute it and/or modify
    1.11 @@ -28,14 +28,33 @@
    1.12  HDRS = type.h bitblt.h tiff2pdf.h
    1.13  MISC = Makefile scanner.l parser.y
    1.14  
    1.15 +TARGETS = tiff2pdf bitblt_test
    1.16 +
    1.17 +AUTO_SRCS = scanner.c parser.tab.c
    1.18 +AUTO_HDRS = parser.tab.h
    1.19 +AUTO_MISC = parser.output
    1.20 +
    1.21  tiff2pdf: tiff2pdf.o scanner.o parser.tab.o
    1.22  
    1.23  bitblt_test: bitblt_test.o bitblt.o
    1.24  
    1.25  
    1.26 -%.tab.c %.tab.h: %.y
    1.27 +clean:
    1.28 +	rm -f *.o *.d $(TARGETS) $(AUTO_SRCS) $(AUTO_HDRS) $(AUTO_MISC) 
    1.29 +
    1.30 +
    1.31 +%.tab.c %.tab.h %.output: %.y
    1.32  	$(YACC) $(YFLAGS) $<
    1.33  
    1.34  # %.c: %.l
    1.35  # 	$(LEX) $(LFLAGS) $<
    1.36  
    1.37 +
    1.38 +ALL_SRCS = $(SRCS) $(AUTO_SRCS)
    1.39 +
    1.40 +DEPENDS = $(ALL_SRCS:.c=.d)
    1.41 +
    1.42 +%.d: %.c
    1.43 +	$(CC) -M -MG $(CFLAGS) $< | sed -e 's@ /[^ ]*@@g' -e 's@^\(.*\)\.o:@\1.d \1.o:@' > $@
    1.44 +
    1.45 +include $(DEPENDS)