-
Notifications
You must be signed in to change notification settings - Fork 34
/
Makefile
64 lines (50 loc) · 2.24 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
REBAR?=rebar
ERLC ?= $(shell which erlc)
ERL ?= $(shell which erlc)
# test if erlang is installed
$(if $(ERLC),,$(warning "Warning: No Erlang found in your path, this will probably not work"))
$(if $(ERL),,$(warning "Warning: No Erlang found in your path, this will probably not work"))
# build testconf
$(if $(shell erlc -o support/ support/conftest.erl),$(warning "could not compile sample program"),)
$(if $(shell erl -pa support/ -s conftest -noshell),$(warning "could not run sample program"),)
$(if $(wildcard "conftest.out"),$(warning "erlang program was not properly executed, (conftest.out was not produced)"),)
include vsn.mk
ERLANG_EI_DIR=`cat conftest.out | head -n 1`
ERLANG_EI_LIB=`cat conftest.out| head -n 2 | tail -n 1`
ERLANG_DIR?=`cat conftest.out | tail -n 1`
LIB_DIR=$(ERLANG_DIR)/lib/percept2-$(VERSION)
all: build
build:
@$(REBAR) compile
clean:
@$(REBAR) clean
@rm -rf support/conftest.beam
@rm -f conftest.out
uninstall:
@-rm -rf ${LIB_DIR}
install: build
@echo "==> Installing Percept2 in $(LIB_DIR)"
@install -m 775 -d $(LIB_DIR)/ebin
@install -m 775 ebin/*.beam $(LIB_DIR)/ebin
@install -m 775 ebin/*.app $(LIB_DIR)/ebin
@install -m 775 -d $(LIB_DIR)/src
@install -m 775 src/*.erl $(LIB_DIR)/src
@install -m 775 -d $(LIB_DIR)/include
@install -m 775 include/*.hrl $(LIB_DIR)/include
@install -m 775 -d $(LIB_DIR)/gplt
@install -m 775 gplt/*.plt $(LIB_DIR)/gplt
@install -m 775 -d $(LIB_DIR)/priv
@install -m 775 -d $(LIB_DIR)/priv/fonts
@install -m 775 -d $(LIB_DIR)/priv/logs
@install -m 775 -d $(LIB_DIR)/priv/server_root/conf
@install -m 775 -d $(LIB_DIR)/priv/server_root/css
@install -m 775 -d $(LIB_DIR)/priv/server_root/htdocs
@install -m 775 -d $(LIB_DIR)/priv/server_root/images
@install -m 775 -d $(LIB_DIR)/priv/server_root/scripts
@install -m 775 -d $(LIB_DIR)/priv/server_root/svgs
@install -m 775 priv/fonts/* $(LIB_DIR)/priv/fonts
@install -m 755 priv/server_root/conf/* $(LIB_DIR)/priv/server_root/conf
@install -m 755 priv/server_root/css/* $(LIB_DIR)/priv/server_root/css
@install -m 755 priv/server_root/htdocs/* $(LIB_DIR)/priv/server_root/htdocs
@install -m 755 priv/server_root/images/* $(LIB_DIR)/priv/server_root/images
@install -m 755 priv/server_root/scripts/* $(LIB_DIR)/priv/server_root/scripts