This repository was archived by the owner on Sep 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (58 loc) · 1.78 KB
/
Makefile
File metadata and controls
79 lines (58 loc) · 1.78 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Flags
export LANG=C
export LC_ALL=C
ERLC_FLAGS+=-W +debug_info
# The all target
.PHONY: all
all: targets build/config.status
# Autoconf & configure
CONFIG_GEN_FILES = $(shell cat build/_gen_files 2>/dev/null)
CONFIG_IN_FILES = $(CONFIG_GEN_FILES:%=%.in)
$(CONFIG_GEN_FILES): build/_tstamp_h
build/_tstamp_h: $(CONFIG_IN_FILES) build/_gen_files
cd build && ./config.status
build/_gen_files: build/configure.in
build/configure: build/configure.in
cd build && autoconf
build/path.mk: build/path.mk.in build/config.status
build/config.status: build/configure
cd build && ./configure
CONFCLEAN := $(CONFCLEAN) $(CONFIG_GEN_FILES) build/configure \
build/config.status build/config.log build/_gen_files \
build/_tstamp_h
CONFDIRCLEAN := build/autom4te.cache/
# Paths and compile command
include build/path.mk
COMP = $(ERLC) $(ERLC_FLAGS) -o $(@D) $(<)
# Subdirectories
## CHANGE HERE WHEN ADDING NEW LIBS
dir := lib/fix
include $(dir)/Rules.mk
# General directory independent rules
INCLUDE_FILES:=$(wildcard */*/src/*.hrl) $(wildcard */*/include/*.hrl)
.INTERMEDIATE: $(INCLUDE_FILES)
.SECONDEXPANSION:
ERL_INCLUDE_FILES:=$(shell find $(ERL_DIR)/lib -name "*.hrl" | \
sed "s,$(ERL_DIR)/lib/,," | \
sed "s,^\(.*\)-[^/]*/\(.*\)/\(.*\),\1/\2/\3,")
.INTERMEDIATE: $(ERL_INCLUDE_FILES)
.SECONDEXPANSION:
$(ERL_INCLUDE_FILES): $$(notdir $$@)
vpath %.hrl $(wildcard $(ERL_DIR)/lib/*/*)
# The variables TGT_* and CLEAN are added to by rules in Rules.*.mk
.PHONY: targets
targets: $(TGT_BIN) $(TGT_SBIN) $(TGT_ETC) $(TGT_LIB)
# The test target
.PHONY: test
test: $(TGT_TEST)
$(TGT_TEST): all
.PHONY: clean
clean:
rm -f $(CLEAN)
## FIXME: find out the standard GNU name for this target.
.PHONY: conf_clean
conf_clean:
rm -f $(CONFCLEAN)
rm -r $(CONFDIRCLEAN)
.PHONY: real_clean
real_clean: clean conf_clean