-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
99 lines (68 loc) · 1.78 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
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
# Makefile
build: beepcore swirl
include config
# ---
.PHONY: beepcore
LBEEP = beepcore-c/lib/libbeepcore.a
IBEEP = beepcore-c/include
beepcore: beepcore-c/lib beepcore-c/include $(LBEEP) $(IBEEP)/CBEEP.h
beepcore-c/lib beepcore-c/include:
$(MKDIR) $@
CBEEP = $(wildcard beepcore-c/core/generic/*.c) $(wildcard beepcore-c/utility/*.c)
HBEEP = $(wildcard beepcore-c/core/generic/*.h) $(wildcard beepcore-c/utility/*.h)
OBEEP = $(CBEEP:.c=.o)
$(OBEEP): $(HBEEP)
$(LBEEP): $(OBEEP)
$(AR) -r $@ $^
$(IBEEP)/CBEEP.h: beepcore-c/core/generic/CBEEP.h
$(CP) $< $@
# ---
.PHONY: swirl
XLUA = $(wildcard lua/*.c)
HLUA = $(wildcard lua/*.h)
OLUA = $(XLUA:.c=.o)
LLUA=lua/$(SOSWIRL)
CFLAGS+=-Ibeepcore-c/include
swirl: beepcore $(LLUA) lua/API.txt
lua/API.txt: lua/swirl.lua lua/swirl.c lua/swirlsock.lua lua/sockext.lua
-ldoc $^ > $@_ && mv $@_ $@
test: swirl
cd lua && lua gc-test
cd lua && lua core-test
cd lua && lua quote-test
$(OLUA): CFLAGS+=$(LUACFLAGS)
$(OLUA): $(HLUA)
$(LLUA): LDFLAGS+=$(LUALDFLAGS)
$(LLUA): $(OLUA) $(LBEEP)
$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
# ---
.PHONY: install
LSHARE=lua/swirl.lua lua/sockext.lua lua/swirlsock.lua
install:
$(MKDIR) $(INSTALL_TOP_LIB)
$(MKDIR) $(INSTALL_TOP_SHARE)
$(CP) $(LLUA) $(INSTALL_TOP_LIB)
$(CP) $(LSHARE) $(INSTALL_TOP_SHARE)
# ---
.PHONY: tag release release-test
FILES=\
lua\
beepcore-c/core/generic\
beepcore-c/utility\
beepcore-c/COPYRIGHT\
config*\
Makefile\
README.txt
VERSION=$(shell date -u "+%y.%m.%d")
BASE=swirl-$(VERSION)
TGZ=../$(BASE).tgz
TAG=v$(VERSION)
TAGMSG="version $(TAG)"
tag:
git tag -f -m $(TAGMSG) $(TAG) master
release: tag
git archive --prefix=swirl-$(VERSION)/ $(TAG) $(FILES) | gzip > $(TGZ)
release-test: release
rm -rf ../$(BASE)
cd ..; tar -xvf $(BASE).tgz
cd ../$(BASE) && $(MAKE) test