Makefile

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