-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
48 lines (39 loc) · 792 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
CC = g++
BUILD_DIR = build
SOURCE_DIR = src
EXECUTABLE = gsw
SOURCES = $(addprefix $(SOURCE_DIR)/*, .cpp /*.cpp)
INSTALL_DIR =
CL =
INST =
UINST =
ifeq ($(OS),Windows_NT)
INSTALL_DIR += $(SystemRoot)
CL += rmdir $(BUILD_DIR) /S /Q
INST += copy $(BUILD_DIR)\$(EXECUTABLE).exe $(INSTALL_DIR)
UINST += del $(INSTALL_DIR)\$(EXECUTABLE).exe
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
INSTALL_DIR += /usr/bin
CL += rm $(BUILD_DIR) -r
INST += cp $(BUILD_DIR)/$(EXECUTABLE) $(INSTALL_DIR)
UINST += rm $(INSTALL_DIR)/$(EXECUTABLE)
endif
endif
main:
mkdir $(BUILD_DIR)
$(CC) -std=c++11 -o $(BUILD_DIR)/$(EXECUTABLE) $(SOURCES)
all:
make
make install
make clean
clean:
$(CL)
install:
$(INST)
update:
make uninstall
make all
uninstall:
$(UINST)