-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
29 lines (24 loc) · 940 Bytes
/
Makefile
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
LIBDIR=`erl -eval 'io:format("~s~n", [code:lib_dir()])' -s init stop -noshell`
PKGNAME=mbcs
VERSION=1.01
ERL_SOURCES := $(wildcard src/*.erl)
ERL_OBJECTS := $(ERL_SOURCES:%.erl=./%.beam)
all: app $(ERL_OBJECTS)
app:
mkdir -p ebin/
cp src/$(PKGNAME).app ebin/
clean:
rm -f ebin/*.beam erl_crash.dump ebin/*.app
package: clean
@mkdir $(PKGNAME)-$(VERSION)/ && cp -rf ebin doc Makefile Readme src t $(PKGNAME)-$(VERSION)
@COPYFILE_DISABLE=true tar zcf $(PKGNAME)-$(VERSION).tgz $(PKGNAME)-$(VERSION)
@rm -rf $(PKGNAME)-$(VERSION)/
install: all
mkdir -p $(prefix)/$(LIBDIR)/$(PKGNAME)-$(VERSION)/ebin $(prefix)/$(LIBDIR)/$(PKGNAME)-$(VERSION)/priv
for i in ebin/*.beam ebin/*.app; do install $$i $(prefix)/$(LIBDIR)/$(PKGNAME)-$(VERSION)/$$i ; done
for i in priv/*; do install $$i $(prefix)/$(LIBDIR)/$(PKGNAME)-$(VERSION)/$$i; done
test: all
prove -v t/*.t
./%.beam: %.erl
@mkdir -p ebin
erlc +debug_info -I include -o ebin $<