-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (29 loc) · 707 Bytes
/
Makefile
File metadata and controls
36 lines (29 loc) · 707 Bytes
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
# Build and run codejam problems
PROGS =2014/qual-a
PROGS+=2014/qual-b
PROGS+=2014/qual-c
PROGS+=2014/qual-d
CXX=g++
CXXFLAGS=-Wall -Werror -std=c++11 -g -O0
.PRONY: all clean check
all: $(PROGS)
$(PROGS): % : %.cpp
@echo ">> BUILD: $@"; \
$(CXX) $(CXXFLAGS) $< -o $@; \
if [ $$? != 0 ]; then \
echo "\033[0;31mFailure\033[0m"; \
else \
echo "\033[0;32mSuccess\033[0m"; \
fi; \
check: $(PROGS)
@for PROG in $(PROGS); do \
echo ">> TEST: $${PROG}"; \
$${PROG} < $${PROG}-input-small.txt; \
if [ $$? != 0 ]; then \
echo "\033[0;31mFailure\033[0m"; \
else \
echo "\033[0;32mSuccess\033[0m"; \
fi; \
done
clean:
@rm $(PROGS) >/dev/null 2>&1 || echo "\033[0;32mCleaned\033[0m"