-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (44 loc) · 1.22 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
56
57
58
59
60
61
62
63
64
65
#
# 'make depend' uses makedepend to automatically generate dependencies
# (dependencies are added to end of Makefile)
# 'make' build executable file './app.out'
# 'make clean' removes all .o and executable files
#
#*# ************************************************************************ #*#
ifeq ($(origin CXX), default)
CXX = g++
endif
CXXFLAGS ?= -w -std=c++11 -O3
INCLUDES =
LFLAGS =
LIBS =
SRCS = ./main.cc
HDR = ./ai.hh
MAIN = ./app.out
ifeq ($(DESTDIR),)
PREFIX := /usr/local
endif
ifeq ($(verbose),true)
ai_echo :=
else
ai_echo := @
endif
#*# ************************************************************************ #*#
OBJS = $(SRCS:.cc=.o)
INSTLIB = $(INSTALL_DIR)/$(HDR)
.PHONY: depend clean
all: $(MAIN)
@echo $(MAIN) has been compiled
$(MAIN): $(OBJS)
$(CXX) $(CXXFLAGS) $(INCLUDES) -o $(MAIN) $(OBJS) $(LFLAGS) $(LIBS)
.cc.o:
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@
clean:
$(RM) ./*.o ./*~ $(MAIN)
install: ai.hh
$(ai_echo)install -d $(DESTDIR)$(PREFIX)/include/
$(ai_echo)install -m 644 ai.hh $(DESTDIR)$(PREFIX)/include/
cd $(DESTDIR)$(PREFIX)/include/ && ln -f -s -v ai.hh ai
depend: $(SRCS)
makedepend $(INCLUDES) $^
# DO NOT DELETE THIS LINE - make depend needs it