-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
92 lines (70 loc) · 2.11 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
LUACLIBS := ../luaclibs/dist
LUAJLS := $(LUACLIBS)
LHA_DIST := dist
# make LUACLIBS=../luaclibs/dist-aarch64-pi LUAJLS=../luajls release
PLAT ?= $(shell grep ^platform $(LUACLIBS)/versions.txt | cut -f2)
TARGET_NAME ?= $(shell grep ^target $(LUACLIBS)/versions.txt | cut -f2)
RELEASE_DATE = $(shell date '+%Y%m%d')
RELEASE_NAME ?= -$(TARGET_NAME).$(RELEASE_DATE)
SO_windows=dll
EXE_windows=.exe
ZIP_windows=.zip
SO_linux=so
EXE_linux=
ZIP_linux=.tar.gz
SO := $(SO_$(PLAT))
EXE := $(EXE_$(PLAT))
MAIN_MK := $(MK_$(PLAT))
ZIP := $(ZIP_$(PLAT))
main: dist-archive
show:
@echo PLAT: $(PLAT)
@echo TARGET_NAME: $(TARGET_NAME)
@echo RELEASE_DATE: $(RELEASE_DATE)
@echo RELEASE_NAME: $(RELEASE_NAME)
@echo LUACLIBS: $(LUACLIBS)
@echo LUAJLS: $(LUAJLS)
dist-bin-linux:
cp -u $(LUACLIBS)/linux.$(SO) $(LHA_DIST)/bin/
dist-bin-windows:
cp -u $(LUACLIBS)/lua*.$(SO) $(LHA_DIST)/bin/
-cp -u $(LUACLIBS)/win32.$(SO) $(FCUT_DIST_CLUA)/
dist-bin: dist-bin-$(PLAT)
cp -u $(LUACLIBS)/lua$(EXE) $(LHA_DIST)/bin/
cp -u $(LUACLIBS)/cjson.$(SO) $(LHA_DIST)/bin/
cp -u $(LUACLIBS)/luv.$(SO) $(LHA_DIST)/bin/
cp -u $(LUACLIBS)/lxp.$(SO) $(LHA_DIST)/bin/
cp -u $(LUACLIBS)/openssl.$(SO) $(LHA_DIST)/bin/
cp -u $(LUACLIBS)/serial.$(SO) $(LHA_DIST)/bin/
cp -u $(LUACLIBS)/zlib.$(SO) $(LHA_DIST)/bin/
-cp -u $(LUACLIBS)/lpeg.$(SO) $(LHA_DIST)/bin/
dist-any:
cp -ru $(LUAJLS)/jls/ $(LHA_DIST)/lua/
cp -ru lha/ $(LHA_DIST)/lua/
cp -u lha.sh $(LHA_DIST)/
cp -u lha.cmd $(LHA_DIST)/
cp -u *.lua $(LHA_DIST)/
cp -ru extensions/ $(LHA_DIST)/
cp -ru assets/ $(LHA_DIST)/
dist-clean:
rm -rf $(LHA_DIST)
dist-bin-prepare:
mkdir $(LHA_DIST)/bin
dist-prepare:
@echo Prepare release $(RELEASE_NAME) for $(PLAT)
-mkdir $(LHA_DIST)
mkdir $(LHA_DIST)/lua
mkdir $(LHA_DIST)/work
dist: dist-clean dist-prepare dist-any
dist-full: dist dist-bin-prepare dist-bin
dist.tar.gz:
cd $(LHA_DIST) && tar --group=jls --owner=jls -zcvf lha$(RELEASE_NAME).tar.gz *
dist.zip:
cd $(LHA_DIST) && zip -q -r lha$(RELEASE_NAME).zip *
dist-archive: dist dist$(ZIP)
dist-full-archive release: dist-full dist$(ZIP)
sync:
git fetch
git rebase
$(MAKE) release
.PHONY: dist