Added all of the MH sources, including RCS files, in
[mmh] / docs / historical / mh-6.8.5 / conf / makefiles / zotnet / tws
1 ##############################################################################
2 #    Instructions to Make, for compilation of ZOT UIP/utility processes
3 #
4 #       @(MHWARNING)
5 # @(#)$Id: tws,v 1.16 1993/02/26 21:50:51 jromine Exp jromine $
6 ##############################################################################
7
8 # The following entries were inserted during MH configuration
9 BINDIR  =       $(DESTDIR)@(MHBINPATH)
10 ETCDIR  =       $(DESTDIR)@(MHETCPATH)
11 OPTIONS =       @(MHOPTIONS) -I..
12 LDOPTIONS=      @(LDOPTIONS)
13 LDOPTLIB=       @(LDOPTLIB)
14
15 CC      =       @(MHCOMPILER)
16 LN      =       @(LN)
17 LEX     =       @(LEX)
18 @BEGIN: OPTIM
19 CFLAGS  =       $(OPTIONS)
20 @END: OPTIM
21 @BEGIN: DEBUG
22 CFLAGS  =             $(OPTIONS)
23 @END: DEBUG
24 LINT    =       lint
25 LFLAGS  =       -bhu $(OPTIONS)
26 LLIBS   =
27 LDFLAGS =       $(LDOPTIONS)
28 LIBES   =
29 LDLIBS  =       $(LIBES) $(LDOPTLIB)
30
31 OFILES  =       dtimep.o lexstring.o dtime.o
32 LFILES  =       l-dtimep l-dtime l-date
33
34 .c:;            echo $@
35
36 ######################################################################
37 #       Here it is...
38 ######################################################################
39
40 all:            $(OFILES) date
41
42 lint:           $(LFILES)
43
44 install:        inst-all clean
45
46 inst-all:;
47
48 tar:;
49
50 uninstall:;
51
52
53 ######################################################################
54 # date
55 ######################################################################
56
57 date:           date.o dtime.o $(LIBES)
58                 $(CC) $(LDFLAGS) -o $@ date.o dtime.o $(LDLIBS)
59
60 l-date:;        $(LINT) $(LFLAGS) date.c dtime.c $(LLIBS)
61
62
63 ######################################################################
64 # dtimep
65 ######################################################################
66
67
68 dtimep:         dtimep.o lexstring.o
69
70 dtimep.o:       dtimep.c
71
72 dtimep.c:       dtimep.lex
73                 $(LEX) dtimep.lex | sed -f lexedit.sed > dtimep.c
74                 -@len=`wc -l dtimep.c | awk ' { print $$1 } '`; \
75                 if [ $$len -gt 10 ]; \
76                 then exit 0; \
77                 else echo "lex failed: using pre-lexed dtimep.c"; \
78                     cp dtimep.c-lexed dtimep.c; \
79                 fi
80
81 lexstring.o:    lexstring.c
82                 $(CC) $(CFLAGS) -c -DONECASE lexstring.c
83
84 l-dtimep:;      $(LINT) $(LFLAGS) dtimep.c -DONECASE lexstring.c $(LLIBS)
85
86
87 ######################################################################
88 # dtime
89 ######################################################################
90
91 dtime:          dtime.o
92
93 l-dtime:;       $(LINT) $(LFLAGS) dtime.c $(LLIBS)
94
95
96 ##############################################################################
97 #       Miscellaneous tasks
98 ##############################################################################
99
100 tws.h:          ../tws.h
101                 rm -f $@
102                 $(LN) ../tws.h $@
103
104 unconfig:       distribution
105                 -rm -f Makefile
106
107 distribution:   clean
108
109 clean:          unclean
110                 -rm -f dtimep.c *.o date
111
112 unclean:;       -rm -f _* :* core eddep makedep
113
114
115 ##############################################################################
116 #       Dependencies
117 ##############################################################################
118
119 MODULES =       date dtime dtimep
120
121 depend:;        for m in $(MODULES); do ( \
122                     i=`basename $$m .c`; \
123                     echo $$i.o: $$i.c >> makedep; \
124                     grep '^#[   ]*include' $$i.c | \
125                         sed -e 's,[^"]*"/\([^"]*\)".*,'$$i'.o: /\1,' \
126                             -e 's,[^"]*"\([^"]*\)".*,'$$i'.o: \1,' \
127                             -e 's,[^<]*<\(.*\)>.*,#'$$i'.o: /usr/include/\1,' \
128                         >> makedep \
129                 ); done
130                 echo '/^# DO NOT DELETE THIS LINE/+2,$$d' > eddep
131                 echo '$$r makedep' >> eddep
132                 echo 'w' >> eddep
133                 cp Makefile _Makefile
134                 ed - Makefile < eddep
135                 rm eddep makedep
136                 echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
137                 echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
138
139 # DO NOT DELETE THIS LINE
140 # DEPENDENCIES START HERE
141 date.o: date.c
142 date.o: ../tws.h
143 #date.o: /usr/include/stdio.h
144 dtime.o: dtime.c
145 dtime.o: ../tws.h
146 dtime.o: ../../h/strings.h
147 #dtime.o: /usr/include/stdio.h
148 #dtime.o: /usr/include/sys/types.h
149 #dtime.o: /usr/include/sys/sysmacros.h
150 #dtime.o: /usr/include/sys/timeb.h
151 #dtime.o: /usr/include/time.h
152 dtimep.o: dtimep.c
153 #dtimep.o: /usr/include/stdio.h
154 dtimep.o: ../tws.h
155 dtimep.o: ../../h/strings.h
156 #dtimep.o: /usr/include/ctype.h
157 #dtimep.o: /usr/include/sys/types.h
158 #dtimep.o: /usr/include/sys/sysmacros.h
159 #dtimep.o: /usr/include/sys/timeb.h
160 #dtimep.o: /usr/include/time.h
161 # DEPENDENCIES MUST END AT END OF FILE
162 # IF YOU PUT STUFF HERE IT WILL GO AWAY