-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (36 loc) · 845 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#
# Boolean expression evaluator
# @author Dani Huertas
# @email huertas.dani@gmail.com
#
CC = g++
CFLAGS = -Wall -std=c++11
SHELL = /bin/bash
TARGET = blvrd
LIBS =
INCLUDE = -I./src
SOURCES = $(shell find ./src -type f -name '*.cc' | sort)
OBJS = $(shell find ./src -type f -name '*.cc' | sort | sed -e 's/\.cc/\.o/g' -e 's/src\//obj\//g')
.PHONY: all test clean
all: debug
debug: CFLAGS += -g
debug: $(TARGET)
release: CFLAGS += -O2
release: $(TARGET)
depend: _depend
_depend: $(SOURCES)
rm -f ./.depend
$(CC) $(CFLAGS) $(INCLUDE) -MM $^ > ./.depend;
obj/%.o: src/%.cc
@mkdir -m 755 -p $$(dirname $@)
$(CC) -c $(CFLAGS) $(INCLUDE) $< -o $@
$(TARGET): $(OBJS)
$(CC) $(CFLAGS) $(OBJS) $(LIBS) -o $(TARGET)
test: release
python test/test.py
clean:
@rm -f .depend
@rm -rf obj
@rm -rf out
@rm -rf ./*.out
@rm -f $(TARGET)