Debian Codegraph @

Makefile

raw symbols SCIP
1 #!/usr/bin/make -f
2
3 APPFILE := uuid.app
4 VERSION := $(shell sed -n -e '/vsn/ {s/.*,[[:blank:]]*"\([0-9][0-9.]*\)".*/\1/' \
5 -e 'p' -e '}' src/$(APPFILE).src)
6
7 PREFIX ?= /usr
8 ERL_ROOT := $(PREFIX)/lib/erlang
9 LIBDIR := /lib
10 DISTDIR := uuid-$(VERSION)
11
12 BEAMFILES := $(wildcard ebin/*.beam) $(wildcard test/*.beam)
13 DIALYZER_PLT := erlang-uuid.plt
14
15 all: build
16
17 build: ebin/$(APPFILE)
18 erl -make
19
20 ebin/$(APPFILE): src/$(APPFILE).src
21 cp $< $@
22
23 clean:
24 -rm -rf dist ebin/$(APPFILE) $(BEAMFILES) $(DIALYZER_PLT)
25
26 $(DIALYZER_PLT): build
27 dialyzer --add_to_plt -r ebin --output_plt $(DIALYZER_PLT)
28
29 dialyzer: $(DIALYZER_PLT)
30 dialyzer --plt $(DIALYZER_PLT) ebin/uuid.beam
31
32 test: build
33 erlc -W +debug_info +compressed +strip -o test/ test/*.erl
34 erl -noshell -pa ebin -pa test -eval "uuid_tests:test()" -eval "init:stop()"
35
36 dist: build
37 # create dist tarball
38 mkdir -p dist/$(DISTDIR)/ebin
39 install -m0644 ebin/* dist/$(DISTDIR)/ebin
40 (cd dist ; tar zcf $(DISTDIR).tar.gz $(DISTDIR) )
41
42 install: build
43 # create dist directory and install files
44 mkdir -p $(DESTDIR)$(ERL_ROOT)$(LIBDIR)/$(DISTDIR)/ebin
45 install -m0644 ebin/* $(DESTDIR)$(ERL_ROOT)$(LIBDIR)/$(DISTDIR)/ebin
46
47 uninstall:
48 -rm -rf $(DESTDIR)$(ERL_ROOT)$(LIBDIR)/uuid-[0-9][0-9.]*
49
50 .PHONY: all build clean dialyzer test install uninstall