-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmk.cpp
More file actions
34 lines (25 loc) · 679 Bytes
/
mk.cpp
File metadata and controls
34 lines (25 loc) · 679 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
ifeq ($(origin Help), undefined)
Help = Help:\n
help:
@echo "$(Help)"
endif
Help += \n**cpp.mk**\n * compile\n *.t run & show time\n *.a run & open the output\n *.graph compile & run (with \"matplotlibcpp.h\")\n clean.cpp Clean c++ compile files.\n
####################
Input = $(if $(wildcard $*.in),< $*.in)
#.PHONY:%.r %.o %.t %.T
%.t:%
time -f "%e s %M KB" ./$* $(Input)
# Time, Memory.
%.T:%
time -p ./$* $(Input)
# -p:basic -v:full
%.a:%
./$* $(Input) > $*.out
code $*.out
%:%.cpp
g++ $< -o $* -Wall -Wextra -Wconversion
%.graph:%.cpp
g++ $< -std=c++11 -I/usr/include/python2.7 -lpython2.7 && ./a.out
rm a.out
clean.cpp:
rm $(basename $(wildcard *.cpp))