This repository has been archived by the owner on Jun 26, 2024. It is now read-only.
forked from japerk/erlaws
-
Notifications
You must be signed in to change notification settings - Fork 6
/
include.mk.in
79 lines (54 loc) · 1.37 KB
/
include.mk.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
###-*-makefile-*- ; force emacs to enter makefile-mode
PREFIX = @prefix@
prefix = ${PREFIX}
ETCDIR = @sysconfdir@
VARDIR = @localstatedir@
ifeq ($(DESTDIR),)
DESTDIR=/
endif
## DESTDIR is handled separately in the individual Makefiles
ERL=@ERL@
WERL=@WERL@
ERLC=@ERLC@
EMULATOR=beam
DEFAULT_CHARSET=@DEFAULT_CHARSET@
EPAM = @EPAM@
EXTRAINCLUDE = @EXTRAINCLUDE@
ERLBINDIR = @ERLBINDIR@
ifdef debug
ERLC_FLAGS+=-Ddebug
endif
ifdef trace
ERLC_FLAGS=+trace
endif
ifdef export_all
ERLC_FLAGS+=-Dexport_all
endif
ifdef debug_info
ERLC_FLAGS+=+debug_info
endif
ERLDIR=@ERLDIR@
APPDIR=$(ERLDIR)/lib/erlaws-$(ERLAWS_VSN)
INSTALL=@INSTALL@
INSTALL_DATA=@INSTALL_DATA@
EMULATOR=beam
ifdef debug
ERLC_FLAGS+=-Ddebug
endif
ifdef trace
ERLC_FLAGS=+trace
endif
ifdef export_all
ERLC_FLAGS+=-Dexport_all
endif
# Hmm, don't know if you are supposed to like this better... ;-)
APPSCRIPT = '$$vsn=shift; $$mods=""; while(@ARGV){ $$_=shift; s/^([A-Z].*)$$/\'\''$$1\'\''/; $$mods.=", " if $$mods; $$mods .= $$_; } while(<>) { s/%VSN%/$$vsn/; s/%MODULES%/$$mods/; print; }'
# Targets
../ebin/%.app: %.app.src ../vsn.mk Makefile
perl -e $(APPSCRIPT) "$(VSN)" $(MODULES) < $< > $@
../ebin/%.appup: %.appup
cp $< $@
../ebin/%.$(EMULATOR): %.erl
"$(ERLC)" $(ERLC_FLAGS) -o ../ebin $<
%.$(EMULATOR): %.erl
"$(ERLC)" $(ERLC_FLAGS) $<