-
Notifications
You must be signed in to change notification settings - Fork 57
/
include.mk.in
80 lines (64 loc) · 1.56 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
80
# This is a -*-makefile-*-
# Copyright 2012-2024 Tail-f Systems AB
#
# See the file "LICENSE" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
ifeq ($(prefix),)
prefix=@PREFIX@
endif
ifeq ($(exec_prefix),)
exec_prefix=@EXEC_PREFIX@
ifeq ($(exec_prefix),DEFAULT)
exec_prefix=$(prefix)
endif
endif
ifeq ($(bindir),)
bindir=@BINDIR@
ifeq ($(bindir),DEFAULT)
bindir=$(exec_prefix)/bin
endif
endif
ifeq ($(sysconfdir),)
sysconfdir=@SYSCONFDIR@
ifeq ($(sysconfdir),DEFAULT)
sysconfdir=$(prefix)/etc
endif
endif
PREFIX=$(prefix)
EXEC_PREFIX=$(exec_prefix)
BINDIR=$(bindir)
SYSCONFDIR=$(sysconfdir)
TARGETDIR=$(PREFIX)/lib/lux
INSTALL=install
INSTALL_DIR=$(INSTALL) -d -m755
INSTALL_DATA=$(INSTALL) -m644
INSTALL_PGM=$(INSTALL) -m755
INSTALL_DIR_AND_DATA = \
$(shell for d in `find $(1) -type d`; do \
$(INSTALL_DIR) $(DESTDIR)$(TARGETDIR)/$$d ; \
f=`find $$d -maxdepth 1 -type f` ; \
$(INSTALL_DATA) $$f $(DESTDIR)$(TARGETDIR)/$$d ; \
done)
APP_DIR=$(shell dirname $(PWD))
LUX=$(APP_DIR)/bin/lux
# Erlang
ERL="@ERL@"
ERLC="@ERLC@"
EMULATOR=beam
ERLC_FLAGS += +warnings_as_errors +warn_unused_vars +debug_info
# C
CC=@CC@
CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@
C_SRC_TARGET=@C_SRC_TARGET@
# Doc
MARKDOWN=@MARKDOWN@
# Targets
../ebin/%.app: %.app.src ../vsn.mk Makefile
sed -e "s/%VSN%/$(VSN)/g" < $< > $@
../ebin/%.appup: %.appup.src ../vsn.mk Makefile
sed -e "s/%VSN%/$(VSN)/g" < $< > $@
../ebin/%.$(EMULATOR): %.erl
$(ERLC) $(ERLC_FLAGS) -o ../ebin $<
%.$(EMULATOR): %.erl
$(ERLC) $(ERLC_FLAGS) $<