forked from avalon-lang/avaloni
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (45 loc) · 1.41 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
48
49
50
51
52
53
54
55
#
# makefile for the avalon compiler
#
# :author Ntwali Bashige
# :year 2017
# :email ntwali.bashige@gmail.com
#
cc := g++
cflags := -std=c++11 -g -Wall -pedantic -DDEBUG -fopenmp
ldpaths := -L/usr/local/lib
rdpaths := -Wl,-rpath=/usr/local/lib
ldflags := -lboost_filesystem -lboost_system -fopenmp
src_dir := src
inc := -Isrc -Ideps/qpp
sysinc := -isystem deps/boost -isystem deps/eigen
build_dir := build
bin_dir := bin
target := $(bin_dir)/avaloni
src_ext := cpp
sources := $(shell find $(src_dir) -type f -name *.$(src_ext))
objects := $(patsubst $(src_dir)/%,$(build_dir)/%,$(sources:.$(src_ext)=.o))
sdk_path := /usr/lib/avalon-sdk
.PHONY: all
all: setup $(target)
$(target): $(objects)
$(cc) $^ -o $(target) $(ldpaths) $(ldflags) $(rdpaths)
$(build_dir)/%.o: $(src_dir)/%.$(src_ext)
@mkdir -p $(dir $@)
$(cc) $(cflags) $(sysinc) $(inc) -c -o $@ $<
install:
@echo " Installing..."
@# Copy the binary for system-wide access into </usr/bin>
@cp $(target) /usr/bin
@# Copy the SDK into the default AVALON_HOME folder at </usr/lib/avalon-sdk>
@mkdir -p $(sdk_path)
@cp -r sdk/* $(sdk_path)
@echo " Installation finished."
.PHONY: setup
setup:
@mkdir -p $(bin_dir)
@mkdir -p $(build_dir)
.PHONY: clean
clean:
@find . -type d \( -path ./docs/venv -o -path ./experiments/quil \) -prune -o -exec touch {} \;
@rm -rf $(build_dir) $(bin_dir)