-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
47 lines (33 loc) · 1.28 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
SHELL = /bin/sh
outdir = .out
srcdir = src
prefix ?= /usr/local
insdir = $(DESTDIR)$(prefix)/bin
json2cbor-src = \
$(srcdir)/json2cbor.cxx
json2json-src = \
$(srcdir)/json2json.cxx
cbor2json-src = \
$(srcdir)/cbor2json.cxx
all: $(outdir)/json2cbor $(outdir)/json2json $(outdir)/cbor2json
$(outdir)/json2cbor: $(json2cbor-src)
@mkdir -p $(outdir)
$(CXX) -I . -DNDEBUG -O3 $(CPPFLAGS) -std=c++11 -Wall $(CXXFLAGS) $(LDFLAGS) $(json2cbor-src) -o $@
$(outdir)/json2json: $(json2json-src)
@mkdir -p $(outdir)
$(CXX) -I . -DNDEBUG -O3 $(CPPFLAGS) -std=c++11 -Wall $(CXXFLAGS) $(LDFLAGS) $(json2json-src) -o $@
$(outdir)/cbor2json: $(cbor2json-src)
@mkdir -p $(outdir)
$(CXX) -I . -DNDEBUG -O3 $(CPPFLAGS) -std=c++11 -Wall $(CXXFLAGS) $(LDFLAGS) $(cbor2json-src) -o $@
clean:
@rm -fr $(outdir)
@rm -fr test/$(outdir)
install: $(outdir)/json2cbor $(outdir)/json2json $(outdir)/cbor2json
@install -d $(insdir)
@install -p -m 4755 $(outdir)/json2cbor $(outdir)/json2json $(outdir)/cbor2json $(insdir)
uninstall:
@rm -f $(insdir)/json2cbor $(insdir)/json2json $(insdir)/cbor2json
check: all
@mkdir -p test/$(outdir) && cp -f $(outdir)/* test/$(outdir)
@$(MAKE) -C test check
.PHONY: all clean install uninstall check