-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (47 loc) · 1.51 KB
/
Copy pathMakefile
File metadata and controls
56 lines (47 loc) · 1.51 KB
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
.PHONY: all release clean install
ifdef PLATFORM
override PLATFORM := $(shell echo $(PLATFORM) | tr "[A-Z]" "[a-z]")
else
PLATFORM = $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
endif
ROOT_PATH = $(shell pwd)
define MAKE_PLATFORM
##main essential builds
cd deps/lua && make $(2); cd $(ROOT_PATH)
cd deps/uv && make PLATFORM=$(1); rm -f libuv.so libuv.dylib; cd $(ROOT_PATH)
cd src && make PLATFORM=$(1) RELEASE=$(3); cd $(ROOT_PATH)
##not essential builds
cd clib/mime && make PLATFORM=$(1) RELEASE=$(3); cd $(ROOT_PATH)
endef
ifeq (darwin,$(PLATFORM))
LUA_PLATFORM = macosx
else
LUA_PLATFORM = $(PLATFORM)
endif
all:
$(call MAKE_PLATFORM,$(PLATFORM),$(LUA_PLATFORM))
release:
$(call MAKE_PLATFORM,$(PLATFORM),$(LUA_PLATFORM),RELEASE)
clean:
##main essential builds
cd deps/lua && make clean; cd $(ROOT_PATH)
cd deps/uv && make clean; cd $(ROOT_PATH)
cd src && make clean; cd $(ROOT_PATH)
##not essential builds
cd clib/mime && make clean; cd $(ROOT_PATH)
# Where to install. The installation starts in the src and doc directories,
# so take care if INSTALL_TOP is not an absolute path.
INSTALL_TOP= /usr/local
INSTALL_BIN= $(INSTALL_TOP)/bin
INSTALL_LIB= $(INSTALL_TOP)/lib
INSTALL= cp -p
MKDIR= mkdir -p
install:
mkdir -p /usr/local/bin /usr/local/lib
##main essential install
cp -f src/node-lua ./node-lua
cp -f src/node-lua /usr/local/bin/node-lua
cp deps/lua/libnlua.so ./libnlua.so
cp deps/lua/libnlua.so /usr/local/lib/libnlua.so
##not essential install
cp clib/mime/mime.so clib/mime.so