blob: 173c91b3d89beed6384b48745270f2b5ae7a7b8a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
#
# /src/NTP/REPOSITORY/v3/parse/Makefile.tmpl,v 3.6 1993/10/10 22:44:36 kardel Exp
#
LIBNAME= libparse
KLIBNAME= libparse_kernel
#
# parse routine that could be used in two places
#
COMPILER= cc
COPTS= -O
AUTHDEFS=-DDES
LIBDEFS= -DBIG_ENDIAN
RANLIB= ranlib
INSTALL= install
CLOCKDEFS=
DEFS=
DEFS_OPT=
DEFS_LOCAL=
#
INCL=-I../include
CFLAGS= $(COPTS) $(DEFS) $(DEFS_LOCAL) $(INCL)
CC= $(COMPILER)
#
SOURCE= parse.c parse_conf.c clk_meinberg.c clk_schmid.c clk_rawdcf.c \
clk_dcf7000.c clk_trimble.c
OBJS= parse.o parse_conf.o clk_meinberg.o clk_schmid.o clk_rawdcf.o \
clk_dcf7000.o clk_trimble.o
all:
@echo $(DEFS) $(DEFS_LOCAL) $(CLOCKDEFS) | \
awk '/-DREFCLOCK/ && /-DPARSE/ && /-DCLOCK_/ { makeit=1; }\
END { if (makeit) \
{ print "echo ; echo --- creating parse libraries ; $(MAKE) $(MFLAGS) MFLAGS=\"$(MFLAGS)\" MAKE=\"$(MAKE)\" libs"; } \
else \
{ print "echo ; echo --- creating parse placebo libraries ; $(MAKE) $(MFLAGS) MFLAGS=\"$(MFLAGS)\" MAKE=\"$(MAKE)\" emptyplacebolibs";} }' |\
sh
@echo $(DEFS) $(DEFS_LOCAL) $(CLOCKDEFS) | \
awk '/-DREFCLOCK/ && /-DPARSE/ && /-DCLOCK_/ {makeit=1; }\
END { if (makeit) \
{ print "echo ; echo --- creating utility programs ; cd util && $(MAKE) $(MFLAGS) MFLAGS=\"$(MFLAGS)\" MAKE=\"$(MAKE)\" -k"; } \
else \
{ print ":";} }' |\
sh
@if (sun) > /dev/null 2>&1; then \
echo $(DEFS) $(DEFS_LOCAL) $(CLOCKDEFS); \
else :; fi | \
awk '/-DSTREAM/ && /-DREFCLOCK/ && /-DPARSE/ && /-DCLOCK_/ { makeit=1; }\
END { if (makeit) \
{ print "echo ; echo --- creating kernel files ; $(MAKE) $(MFLAGS) MFLAGS=\"$(MFLAGS)\" MAKE=\"$(MAKE)\" -f Makefile.kernel"; } \
else \
{ print ":";} }' |\
sh
emptyplacebolibs: empty.c
@if [ ! -f "$(LIBNAME).a" -o ! -f "$(KLIBNAME).a" ]; then \
$(CC) -c empty.c; \
rm -f $(LIBNAME).a $(KLIBNAME).a; \
ar r $(LIBNAME).a empty.o; \
$(RANLIB) $(LIBNAME).a; \
ar r $(KLIBNAME).a empty.o; \
$(RANLIB) $(KLIBNAME).a; \
rm -f empty.o; \
else \
: sorry guys - but i always get bitten by the broken ultrix sh; \
fi
libs: $(LIBNAME).a $(KLIBNAME).a
$(LIBNAME).a: $(SOURCE)
$(CC) -c $(CFLAGS) $(CLOCKDEFS) -UPARSESTREAM $(SOURCE)
ar rv $@ $(OBJS)
rm -f $(OBJS)
$(RANLIB) $@
$(KLIBNAME).a: $(SOURCE) $(LIBNAME).a
$(CC) -c $(CFLAGS) $(CLOCKDEFS) -DPARSESTREAM $(SOURCE)
ar rv $@ $(OBJS)
rm -f $(OBJS)
$(RANLIB) $@
lintlib: llib-l$(LIBNAME).ln
llib-l$(LIBNAME).ln: $(SOURCE)
lint -C$(LIBNAME) $(INCL) $(CLOCKDEFS) $(AUTHDEFS) $(LIBDEFS) $(SOURCE) >lintlib.errs
lint:
lint -u $(DEFS) $(INCL) $(CLOCKDEFS) $(AUTHDEFS) $(LIBDEFS) $(SOURCE) >lint.errs
depend:
mkdep $(CFLAGS) $(SOURCE)
clean:
-@rm -f $(LIBNAME).a $(KLIBNAME).a *.o *.out *.ln make.log Makefile.bak \
lintlib.errs lint.errs genassym assym.s parsestreams parse
-@cd util && $(MAKE) $(MFLAGS) MFLAGS="$(MFLAGS)" -f Makefile.tmpl clean
distclean: clean
-@rm -f *.orig *.rej .version Makefile
-@cd util && $(MAKE) $(MFLAGS) MFLAGS="$(MFLAGS)" -f Makefile.tmpl distclean
install: all
@echo $(DEFS) $(DEFS_LOCAL) $(CLOCKDEFS) | \
awk '/-DREFCLOCK/ && /-DPARSE/ && /-DCLOCK_/ { makeit=1; }\
END { if (makeit) \
{ print "echo --- installing utility programs ; cd util && $(MAKE) MAKE=\"$(MAKE)\" $@"; } \
else \
{ print ":";} }' |\
sh
@echo "--- Kernel modules like "parse" or "parsestreams.o" must be installed manually"
@echo "--- if applicable."
|