-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
55 lines (37 loc) · 1.29 KB
/
Makefile
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
MODULE = xot
DEST = /maint/module/$(MODULE)
INSTALLED = $(foreach f, Driver.o $(ALL), $(DEST)/$f)
ALL = Master Node Space.c System xot.h
CC = cc
LDLIBS = -lsocket
CFLAGS = -I. -O -D_KERNEL=1 -DXOT_DEBUG
PARTS = xot.o
XOT_H = /usr/include/atlantic/xot.h
VERSION = ../makeversion
all: xotlink Driver.o
install: $(INSTALLED) $(DEST)/Makefile
$(PARTS): xot.h
Driver.o: $(PARTS)
$(LD) -r $(PARTS) -o $@
chmod a+r Driver.o
xot.o: xot.c xot.h private.h version.h
version.h: xot.c xot.h private.h
-$(VERSION) version.h "X25/TCP (XOT) Driver" $^
$(INSTALLED): $(DEST)/% : %
@if [ ! -d $(@D) ]; then mkdir $(@D) ; fi
cp -f $< $@
$(DEST)/Makefile: Makefile
@rm -f zzmakefile
@echo "install: $(XOT_H)" >> zzmakefile
@echo " /etc/conf/bin/idinstall -k -M $(MODULE)" >> zzmakefile
@echo " /etc/conf/bin/idinstall -k -u $(MODULE)" >> zzmakefile
@echo " /etc/conf/bin/idbuild -M $(MODULE)" >> zzmakefile
@echo >> zzmakefile
@echo "$(XOT_H): xot.h" >> zzmakefile
@echo " @if [ ! -d $$(@D) ]; then mkdir $$(@D); fi" >> zzmakefile
@echo " cp -f $$(@F) $$(@D)" >> zzmakefile
@echo >> zzmakefile
cp -f zzmakefile $@
@rm zzmakefile
xot.tgz: LICENSE README $(ALL) Makefile version.h xot.c private.h xotlink.c xotlink.cf
tar czvf $@ $^