forked from RefactoringTools/wrangler
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.in
151 lines (111 loc) · 4.38 KB
/
Makefile.in
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
APPNAME = wrangler
include vsn.mk
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
LIB_DIR = @ERLANG_INSTALL_LIB_DIR@/$(APPNAME)-$(VERSION)
ERL = "@ERL@"
ERLC = "@ERLC@"
DOC_OPTS={def,{version,\"$(VERSION)\"}}
########################################
## Main part
BUILD_FIRST = ebin/wrangler_parse.beam ebin/wrangler_expand_rule.beam \
ebin/wrangler_scan.beam ebin/wrangler_epp_dodger.beam ebin/wrangler_syntax.beam \
ebin/wrangler_syntax_lib.beam ebin/wrangler_misc.beam ebin/api_ast_traverse.beam ebin/api_refac.beam
ERL_SRC = $(wildcard src/*.erl)
ERL_GEN_REFACS_SRC = $(wildcard src/gen_refacs/*.erl)
ERL_MY_GEN_REFACS_SRC= $(wildcard src/my_gen_refacs/*.erl)
ERL_GEN_COMP_SRC = $(wildcard src/gen_composite_refacs/*.erl)
ERL_MY_GEN_COMP_SRC = $(wildcard src/my_gen_composite_refacs/*.erl)
ERL_OBJ = $(BUILD_FIRST) $(patsubst src/%.erl,ebin/%.beam,$(ERL_SRC)) \
$(patsubst src/gen_refacs/%.erl, ebin/%.beam, $(ERL_GEN_REFACS_SRC)) \
$(patsubst src/my_gen_refacs/%.erl, ebin/%.beam, $(ERL_MY_GEN_REFACS_SRC)) \
$(patsubst src/gen_composite_refacs/%.erl, ebin/%.beam, $(ERL_GEN_COMP_SRC)) \
$(patsubst src/my_gen_composite_refacs/%.erl, ebin/%.beam, $(ERL_MY_GEN_COMP_SRC))
.PHONY: default all conf erl c elisp
default: conf erl c elisp
all: default docs
CONF_SRC = Makefile.in c_src/suffixtree/Makefile.in \
c_src/gsuffixtree/Makefile.in
CONF_OBJ = $(patsubst %.in,%,$(CONF_SRC))
ELISP_SRC = elisp/wrangler.el.src
ELISP_OBJ = $(patsubst elisp/%.src, elisp/%, $(ELISP_SRC))
conf: $(CONF_OBJ)
erl: $(ERL_OBJ)
c:
@cd ./c_src; make; cd ../..
elisp: $(ELISP_OBJ)
########################################
## Rules
$(CONF_OBJ): configure $(CONF_SRC)
./configure
.SUFFIXES: .erl .yrl
## Erlang
ebin/%.beam: src/%.erl
$(ERLC) -pa ebin -I include -W -o ebin +debug_info $<
ebin/%.beam: src/gen_refacs/%.erl
$(ERLC) -pa ebin -I include -W -o ebin +debug_info $<
ebin/%.beam: src/my_gen_refacs/%.erl
$(ERLC) -pa ebin -I include -W -o ebin +debug_info $<
ebin/%.beam: src/gen_composite_refacs/%.erl
$(ERLC) -pa ebin -I include -W -o ebin +debug_info $<
ebin/%.beam: src/my_gen_composite_refacs/%.erl
$(ERLC) -pa ebin -I include -W -o ebin +debug_info $<
ebin/%.beam: include/wrangler.hrl include/wrangler_internal.hrl
src/%.erl: src/%.yrl
$(ERLC) -o src $<
$(ELISP_OBJ): $(ELISP_SRC)
cp $(ELISP_SRC) $(ELISP_OBJ);
escript ebin/dynamic_menu_items >>$(ELISP_OBJ)
########################################
clean:
@cd ./c_src; make clean; cd ../..
@-rm -f ${ERL_OBJ} src/wrangler_parse.erl
@-rm -f $(ELISP_OBJ)
@-rm -f priv/suffixtree priv/gsuffixtree
@-rm -f doc/*.html doc/edoc-info doc/erlang.png doc/stylesheet.css
@-rm -f doc/*.erl
distclean: clean
@-rm -f $(CONF_OBJ)
@-rm -f config.* configure.scan
@-rm -rf autom4te.cache
install: default
@echo "* Installing Emacs Lisp Library"
install -m 775 -d $(LIB_DIR)/elisp
install -m 775 elisp/*.el $(LIB_DIR)/elisp
@echo
@echo "* Installing Erlang Library"
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)/priv
install -m 775 priv/suffixtree* $(LIB_DIR)/priv
install -m 755 priv/gsuffixtree* $(LIB_DIR)/priv
install -m 775 priv/side_effect_plt $(LIB_DIR)/priv
install -m 775 priv/dialyzer_plt $(LIB_DIR)/priv
@echo
@echo "*** Successfully installed. See README for usage instructions."
@echo
wc:
@echo "* Emacs Lisp"
@wc -l */*.el | sort -nr
@echo "* Erlang"
@wc -l */*.erl | sort -nr
@echo "* C"
@wc -l */*.c | sort -nr
EXAMPLE_CODE = inspec_examples.erl \
gen_refacs/refac_apply_to_remote_call.erl gen_refacs/refac_remove_an_argument.erl \
gen_refacs/refac_remove_an_import_attribute.erl gen_refacs/refac_add_an_import_attribute.erl \
gen_refacs/refac_specialise_a_function.erl gen_refacs/refac_keysearch_to_keyfind.erl gen_refacs/refac_swap_function_arguments.erl \
gen_composite_refacs/refac_batch_clone_elimination.erl \
gen_composite_refacs/refac_batch_prefix_module.erl \
refac_batch_rename_fun.erl
docs:
$(ERL) -noshell -eval "edoc:application($(APPNAME), \".\", [$(DOC_OPTS), {packages, false}])" -s init stop
(cd src ; cp $(EXAMPLE_CODE) ../doc/)
privdocs:
$(MAKE) DOC_OPTS='$(DOC_OPTS)',private docs