Initial revision
[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
25 .SUFFIXES:
26 .SUFFIXES: .c .o
27
28 .c.o:
29         $(COMPILE) $<
30
31 # header files
32 HDRS = tws.h
33
34 # source files
35 SRCS = dtime.c lexstring.c
36
37 # object files
38 OBJS = dtimep.o dtime.o lexstring.o
39
40 # auxiliary files
41 AUX = Makefile.in dtimep.lex lexedit.sed dtimep.c-lexed
42
43 # all files in this directory included in the distribution
44 DIST = $(HDRS) $(SRCS) $(AUX)
45
46 # ========= DEPENDENCIES FOR BUILDING ==========
47
48 all: $(OBJS)
49
50 # This will bomb if lex is really flex, so check
51 # file and use pre-generated version if necessary
52 dtimep.c: $(srcdir)/dtimep.lex $(srcdir)/lexedit.sed
53         $(LEX) -nt $(srcdir)/dtimep.lex | $(SED) -f $(srcdir)/lexedit.sed > $@
54         -@len=`wc -l $@ | $(AWK) ' { print $$1 } '`; \
55         if [ $$len -gt 500 ]; \
56           then exit 0; \
57         else \
58           echo "LEX FAILED: using pre-lexed $@"; \
59           cp $(srcdir)/$@-lexed $@; \
60         fi
61
62 # This needs to be generated by lex, not flex
63 dtimep.c-lexed: $(srcdir)/dtimep.lex $(srcdir)/lexedit.sed
64         $(LEX) -nt $(srcdir)/dtimep.lex | $(SED) -f $(srcdir)/lexedit.sed > $(srcdir)/$@
65
66 install:
67
68 uninstall:
69
70 # ========== DEPENDENCIES FOR CLEANUP ==========
71
72 mostlyclean:
73         rm -f *.o *~
74
75 clean: mostlyclean
76         rm -f dtimep.c
77
78 distclean: clean
79         rm -f Makefile
80
81 realclean: distclean
82         rm -f dtimep.c-lexed
83
84 superclean: realclean
85
86 # ========== DEPENDENCIES FOR MAINTENANCE ==========
87
88 subdir = zotnet/tws
89
90 Makefile: Makefile.in ../../config.status
91         cd ../.. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
92  
93 distdir = ../../`cat ../../distname`/$(subdir)
94 nmhdist: $(DIST)
95         @echo "Copying distribution files in $(subdir)"
96         @for file in $(DIST); do \
97           cp -p $(srcdir)/$$file $(distdir); \
98         done
99