2 # Makefile for zotnet/tws subdirectory
9 top_srcdir = @top_srcdir@
16 INCLUDES = -I../.. -I$(srcdir) -I$(top_srcdir)
18 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS)
25 LINTFLAGS = @LINTFLAGS@
37 SRCS = dtime.c lexstring.c
40 OBJS = dtimep.o dtime.o lexstring.o
43 AUX = Makefile.in dtimep.lex lexedit.sed dtimep.c-lexed
45 # all files in this directory included in the distribution
46 DIST = $(HDRS) $(SRCS) $(AUX)
48 # ========= DEPENDENCIES FOR BUILDING ==========
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 ]; \
60 echo "LEX FAILED: using pre-lexed $@"; \
61 cp $(srcdir)/$@-lexed $@; \
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)/$@
72 # ========== DEPENDENCIES FOR CLEANUP ==========
88 # ========== DEPENDENCIES FOR LINT =================
91 $(LINT) $(LINTFLAGS) $(INCLUDES) $(DEFS) $(SRCS)
93 # ========== DEPENDENCIES FOR MAINTENANCE ==========
97 Makefile: Makefile.in ../../config.status
98 cd ../.. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
100 distdir = ../../`cat ../../distname`/$(subdir)
102 @echo "Copying distribution files in $(subdir)"
103 @for file in $(DIST); do \
104 cp -p $(srcdir)/$$file $(distdir); \