-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (28 loc) · 824 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
BINARY_DIR=bin/
SERVER_NAME=server
TERM_NAME=term
TEST_NAME=test
SERVER=cmd/server.go
TERM=cmd/term.go
TEST=cmd/test_main.go
all: compile
compile: | $(BINARY_DIR)
@go build -o $(BINARY_DIR)$(SERVER_NAME) $(SERVER)
@go build -o $(BINARY_DIR)$(TERM_NAME) $(TERM)
@go build -o $(BINARY_DIR)$(TEST_NAME) $(TEST)
@printf "\033[33mbuild\033[0m\n"
$(BINARY_DIR):
@mkdir -p bin
@printf "\033[36mcreate dir binary dir\033[0m\n"
run_server:
@printf "\033[33mRUN SERVER\033[0m\n"
@$(BINARY_DIR)$(SERVER_NAME)
run_term: compile
@printf "\033[33mRUN TERM\033[0m\n"
@$(BINARY_DIR)$(TERM_NAME)
run_test:
@printf "\033[33mRUN TERM\033[0m\n"
@$(BINARY_DIR)$(TEST_NAME)
clean:
@rm -rf $(INFO_DIR) $(BINARY_DIR)
@printf "\033[31mdeleted $(INFO_DIR)\033[0m\n\033[31mdeleted $(BINARY_DIR)\033[0m\n\033[33mClean ok\033[0m\n"