added lint targets for Makefiles and a configure test to find whether lclint or lint...
[mmh] / zotnet / tws / Makefile.in
1 #
2 # Makefile for zotnet/tws subdirectory
3 #
4 # $Id$
5 #
6
7 SHELL = /bin/sh
8
9 top_srcdir = @top_srcdir@
10 srcdir     = @srcdir@
11 VPATH      = @srcdir@
12
13 CC         = @CC@
14 CFLAGS     = @CFLAGS@
15 DEFS       = @DEFS@
16 INCLUDES   = -I../.. -I$(srcdir) -I$(top_srcdir)
17
18 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS)
19
20 AWK = @AWK@
21 # LEX = @LEX@
22 LEX = lex
23 SED = sed
24 LINT = @LINT@
25 LINTFLAGS = @LINTFLAGS@
26
27 .SUFFIXES:
28 .SUFFIXES: .c .o
29
30 .c.o:
31         $(COMPILE) $<
32
33 # header files
34 HDRS = tws.h
35
36 # source files
37 SRCS = dtime.c lexstring.c
38
39 # object files
40 OBJS = dtimep.o dtime.o lexstring.o
41
42 # auxiliary files
43 AUX = Makefile.in dtimep.lex lexedit.sed dtimep.c-lexed
44
45 # all files in this directory included in the distribution
46 DIST = $(HDRS) $(SRCS) $(AUX)
47
48 # ========= DEPENDENCIES FOR BUILDING ==========
49
50 all: $(OBJS)
51
52 # This will bomb if lex is really flex, so check
53 # file and use pre-generated version if necessary
54 dtimep.c: $(srcdir)/dtimep.c-lexed $(srcdir)/dtimep.lex $(srcdir)/lexedit.sed
55         $(LEX) -nt $(srcdir)/dtimep.lex | $(SED) -f $(srcdir)/lexedit.sed > $@
56         -@len=`wc -l $@ | $(AWK) ' { print $$1 } '`; \
57         if [ $$len -gt 500 ]; \
58           then exit 0; \
59         else \
60           echo "LEX FAILED: using pre-lexed $@"; \
61           cp $(srcdir)/$@-lexed $@; \
62         fi
63
64 # This needs to be generated by lex, not flex
65 dtimep.c-lexed: $(srcdir)/dtimep.lex $(srcdir)/lexedit.sed
66         $(LEX) -nt $(srcdir)/dtimep.lex | $(SED) -f $(srcdir)/lexedit.sed > $(srcdir)/$@
67
68 install:
69
70 uninstall:
71
72 # ========== DEPENDENCIES FOR CLEANUP ==========
73
74 mostlyclean:
75         rm -f *.o *~
76
77 clean: mostlyclean
78         rm -f dtimep.c
79
80 distclean: clean
81         rm -f Makefile
82
83 realclean: distclean
84         rm -f dtimep.c-lexed
85
86 superclean: realclean
87
88 # ========== DEPENDENCIES FOR LINT =================
89
90 lint: 
91         $(LINT) $(LINTFLAGS) $(INCLUDES) $(DEFS) $(SRCS)
92
93 # ========== DEPENDENCIES FOR MAINTENANCE ==========
94
95 subdir = zotnet/tws
96
97 Makefile: Makefile.in ../../config.status
98         cd ../.. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
99  
100 distdir = ../../`cat ../../distname`/$(subdir)
101 nmhdist: $(DIST)
102         @echo "Copying distribution files in $(subdir)"
103         @for file in $(DIST); do \
104           cp -p $(srcdir)/$$file $(distdir); \
105         done
106