-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (32 loc) · 901 Bytes
/
Makefile
File metadata and controls
44 lines (32 loc) · 901 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
## =====================================================
# Copyright © hk. 2022-2022. All rights reserved.
# File name: Makefile
# Author : fanhua
# Description: Makefile文件
## =====================================================
#
TARGET1=serverFTP
TARGET2=clientFTP
CC = gcc
# 链接库
SO_LIB =
A_LIB =
DEBUG = -g -O2 -Wall
CFLAGS += $(DEBUG)
# 所有.c文件去掉后缀
TARGET_LIST = ${patsubst %.c, %, ${wildcard *.c}}
OBJ_LIST = ${patsubst %.c, %.o, ${wildcard *.c}}
all : $(TARGET1) $(TARGET2)
$(TARGET1): serverFTP.o
$(CC) $(CFLAGS) $< -o $@ $(A_LIB)
$(TARGET2): clientFTP.o
$(CC) $(CFLAGS) $< -o $@ $(A_LIB)
$(OBJ_LIST): %.o : %.c
$(CC) $(CFLAGS) -c $< -o $@
.PHONY: all clean clean_o clean_out
clean : clean_o clean_out
@rm -vf $(TARGET_LIST) $(TARGET1) $(TARGET2)
clean_o :
@rm -vf *.o
clean_out :
@rm -vf *.out