-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
121 lines (95 loc) · 2.85 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#
# Makefile
#
# Created by CC on 2018/10/12.
# Copyright 2018 - now youhua deng (deng you hua | CC) <ccworld1000@gmail.com>
# https://github.com/ccworld1000/CCLog
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
#
TARGET := CCLog
CC := gcc
CFLAG := -Wall
CFLAG += -ICCLog/include
INCLUDES:= -I. -ICCLog/include
libName := libCCLog.so
ShareFlag := -fPIC -shared
dylibName := libCCLog.dylib
dylibFlag := -dynamiclib -current_version 1.0
SRCS := CCLog/src/ccnormal.c\
CCLog/src/ccwarning.c\
CCLog/src/ccerror.c\
CCLog/src/cctimer.c\
CCLog/src/ccloop.c\
CCLog/src/ccthread.c\
CCLog/src/ccprint.c\
CCLog/src/ccsay.c\
CCLog/src/ccdie.c\
CCLog/src/ccnetwork.c\
CCLog/src/CCLog.c
OBJS := $(SRCS:.c=.o)
all : $(OBJS) shell lib dylib resources
.PHONY :all
$(CC) $(LDFLAG) -o $(TARGET) $^
%.o:%.c
$(CC) -c $(CFLAG) $(CPPFLAG) $< -o $@
clean:
rm -rf $(SRCS:.c=.o)
rm -rf CCLog/bin/cc*
rm -rf CCLog/lib/*.so
rm -rf CCLog/lib/*.dylib
rm -rf CCLog/resources/*.so
rm -rf CCLog/resources/*.dylib
shell: ccnormal\
ccwarning\
ccerror\
cctimer\
ccloop\
ccthread\
ccprint\
ccsay\
ccdie\
ccnetwork
ccnormal:
$(CC) -o CCLog/bin/ccnormal CCLog/src/CCLog.o CCLog/src/ccnormal.o
ccwarning:
$(CC) -o CCLog/bin/ccwarning CCLog/src/CCLog.o CCLog/src/ccwarning.o
ccerror:
$(CC) -o CCLog/bin/ccerror CCLog/src/CCLog.o CCLog/src/ccerror.o
cctimer:
$(CC) -o CCLog/bin/cctimer CCLog/src/CCLog.o CCLog/src/cctimer.o
ccloop:
$(CC) -o CCLog/bin/ccloop CCLog/src/CCLog.o CCLog/src/ccloop.o
ccthread:
$(CC) -o CCLog/bin/ccthread CCLog/src/CCLog.o CCLog/src/ccthread.o
ccprint:
$(CC) -o CCLog/bin/ccprint CCLog/src/CCLog.o CCLog/src/ccprint.o
ccsay:
$(CC) -o CCLog/bin/ccsay CCLog/src/CCLog.o CCLog/src/ccsay.o
ccdie:
$(CC) -o CCLog/bin/ccdie CCLog/src/CCLog.o CCLog/src/ccdie.o
ccnetwork:
$(CC) -o CCLog/bin/ccnetwork CCLog/src/CCLog.o CCLog/src/ccnetwork.o
lib:
$(CC) $(ShareFlag) $(CFLAG) $(CPPFLAG) CCLog/src/CCLog.c -o CCLog/lib/$(libName)
cp CCLog/lib/*.so CCLog/resources
dylib:
$(CC) $(dylibFlag) $(CFLAG) $(CPPFLAG) CCLog/src/CCLog.o -o CCLog/lib/$(dylibName)
cp CCLog/lib/*.dylib CCLog/resources
resources:
cp CCLog/lib/*.dylib CCLog/resources
cp CCLog/lib/*.so CCLog/resources