-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile.client
More file actions
45 lines (34 loc) · 847 Bytes
/
Makefile.client
File metadata and controls
45 lines (34 loc) · 847 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
37
38
39
40
41
42
43
44
45
TARGET = client
CC = gcc
LD = ld
FORMATTER = clang-format-3.8
FORMATTER_ARGS = -i -style=file
INC_DIR = include
OBJ_DIR = obj
SRC_DIR = src
OUT_DIR = out
CFLAGS = -Wall -g
CFLAGS += -I./$(INC_DIR)
LIBS = -lm
LIBS += -lpthread
FILENAME = client
SRC = $(SRC_DIR)/$(FILENAME).c
OBJ = $(patsubst $(SRC_DIR)/%, $(OBJ_DIR)/%, $(SRC:.c=.o))
$(OBJ_DIR)/%.o : $(SRC)
@echo " [CC] $<"
$(CC) $(CFLAGS) -c $< -o $@
$(TARGET) : $(OBJ)
@echo " [LD] $@"
$(CC) -o $(OUT_DIR)/$@ $^ $(LIBS)
# To start over from scratch, type 'make clean'. This
# removes the executable file, as well as old .o object
# files and *~ backup files:
clean:
@echo " [RM] $(OBJ)"
@$(RM) $(OBJ)
@echo " [RM] $(TARGET) "
@$(RM) $(OUT_DIR)/$(TARGET)
@$(RM) $(SRC_DIR)/.*~ $(SRC_DIR)/*~
@$(RM) $(INC_DIR)/.*~ $(INC_DIR)/*~
@$(RM) ./.*~
.PHONY: clean