-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
55 lines (45 loc) · 2.02 KB
/
Makefile.am
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
## Makefile.am
##
## Process this file with automake to produce Makefile.in
SUBDIRS = include ebin doc test priv
RELEASE_NAME = $(PACKAGE_NAME)-$(PACKAGE_VERSION)
.PHONY: release
release: $(RELEASE_NAME).tar.gz
$(RELEASE_NAME).rel: $(PACKAGE_NAME).rel
cp $< $@
ERLTMP := $(shell mktemp -d)
if MAKE_TAR_EXTRA_FILES
$(RELEASE_NAME).tar.gz: $(RELEASE_NAME).rel ebin/$(PACKAGE_NAME).appup sys.config
mkdir -p $(ERLTMP)/lib/$(RELEASE_NAME)
cp -r $(DESTDIR)/$(ERLANG_INSTALL_LIB_DIR)/$(RELEASE_NAME)/* $(ERLTMP)/lib/$(RELEASE_NAME)
ERL_LIBS=$(ERLTMP)/lib:$(ERL_LIBS) RELDIR=releases $(ERL) \
-noinput -boot_var OTPHOME lib \
-eval "systools:make_script(\"$(RELEASE_NAME)\", \
[{variables, [{\"OTPHOME\", \"$(ERLTMP)\"}]}])" \
-eval "{ok, [{release, _, _, Apps}]} = file:consult(\"$(RELEASE_NAME).rel\"), \
ExtraFiles = [{code:where_is_file(atom_to_list(App) ++ \".appup\"), \
filename:join([lib, atom_to_list(App) ++ \"-\" ++ Vsn, ebin, \
atom_to_list(App) ++ \".appup\"])} \
|| {App, Vsn} <- Apps, \
filelib:is_regular(code:where_is_file(atom_to_list(App) ++ \".appup\"))], \
systools:make_tar(\"$(RELEASE_NAME)\", \
[{dirs, [include,doc]}, {extra_files, ExtraFiles}])" \
-s init stop
rm -rf $(ERLTMP)
else
$(RELEASE_NAME).tar.gz: $(RELEASE_NAME).rel ebin/$(PACKAGE_NAME).appup sys.config
mkdir -p $(ERLTMP)/lib/$(RELEASE_NAME)
cp -r $(DESTDIR)/$(ERLANG_INSTALL_LIB_DIR)/$(RELEASE_NAME)/* $(ERLTMP)/lib/$(RELEASE_NAME)
ERL_LIBS=$(ERLTMP)/lib:$(ERL_LIBS) RELDIR=releases $(ERL) \
-noinput -boot_var OTPHOME lib \
-eval "systools:make_script(\"$(RELEASE_NAME)\", \
[{variables, [{\"OTPHOME\", \"$(ERLTMP)\"}]}])" \
-eval "systools:make_tar(\"$(RELEASE_NAME)\", [{dirs, [include,doc]}])" \
-s init stop
rm -rf $(ERLTMP)
endif
install-data-hook: $(RELEASE_NAME).tar.gz
$(MKDIR_P) $(DESTDIR)/$(reldir)
$(INSTALL_DATA) $< $(DESTDIR)/$(reldir)
EXTRA_DIST = $(RELEASE_NAME).tar.gz
CLEANFILES = $(RELEASE_NAME).rel $(RELEASE_NAME).script $(RELEASE_NAME).boot $(RELEASE_NAME).tar.gz