-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile.in
212 lines (180 loc) · 4.61 KB
/
Makefile.in
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# -*- mode: mak; indent-tabs-mode: t; tab-width: 8 -*-
# $Id: Makefile.in,v 1.47 2024/04/17 16:00:29 cvsuser Exp $
# libmisc makefile.
#
#
# Copyright (c) 1998 - 2024, Adam Young.
# All rights reserved.
#
# This file is part of the GRIEF Editor.
#
# The GRIEF Editor is free software: you can redistribute it
# and/or modify it under the terms of the GRIEF Editor License.
#
# Redistributions of source code must retain the above copyright
# notice, and must be distributed with the license document above.
#
# Redistributions in binary form must reproduce the above copyright
# notice, and must include the license document above in
# the documentation and/or other materials provided with the
# distribution.
#
# The GRIEF Editor 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
# License for more details.
# ==end==
#
@SET_MAKE@
ROOT= @abs_top_builddir@
top_builddir= @top_builddir@
# File extensions
C= .c
O= .o
H= .h
A= .a
LP= lib
CLEAN= *.bak *~ *.BAK *.swp *.tmp core *.core a.out
XCLEAN=
# Compilers, programs
CC= @CC@
AR= @AR@
RANLIB= @RANLIB@
RM= @RM@
# Configuration
ifeq ("$(BUILD_TYPE)","") #default
BUILD_TYPE= debug
MAKEFLAGS+= BUILD_TYPE=debug
endif
ifneq ("$(BUILD_TYPE)","release")
RTSUFFIX=d
endif
# Directories
D_INC= $(ROOT)/include
D_BIN= $(ROOT)/bin@TOOLCHAINEXT@/$(BUILD_TYPE)
D_OBJ= $(ROOT)/obj@TOOLCHAINEXT@/$(BUILD_TYPE)/libmisc
D_LIB= $(ROOT)/lib@TOOLCHAINEXT@/$(BUILD_TYPE)
# Common flags
XFLAGS=
CFLAGS= @CFLAGS@
CWARN= @CWARN@ $(CWALL)
CDEBUG= @CDEBUG@
CRELEASE= @CRELEASE@
CXXFLAGS= @CXXFLAGS@
CXXDEBUG= @CXXDEBUG@
ifeq ("$(CXXDEBUG)","")
CXXDEBUG= $(CDEBUG)
endif
CXXRELEASE= @CXXRELEASE@
ifeq ("$(CXXRELEASE)","")
CXXRELEASE= $(CRELEASE)
endif
LDDEBUG= @LDDEBUG@
LDRELEASE= @LDRELEASE@
CINCLUDE= -I$(D_INC) @CINCLUDE@
CEXTRA= @DEFS@
ifeq ("win32","@build_os@")
CEXTRA+= -DWIN32
endif
ifeq ("$(BUILD_TYPE)","release")
CFLAGS+= $(CRELEASE) $(CWARN) $(CINCLUDE) $(CEXTRA) $(XFLAGS)
CXXFLAGS+= $(CXXRELEASE) $(CWARN) $(CINCLUDE) @CXXINCLUDE@ $(CEXTRA) $(XFLAGS)
LDFLAGS= $(LDRELEASE) @LDFLAGS@
else
CFLAGS+= $(CDEBUG) $(CWARN) $(CINCLUDE) $(CEXTRA) $(XFLAGS)
CXXFLAGS+= $(CXXDEBUG) $(CWARN) $(CINCLUDE) @CXXINCLUDE@ $(CEXTRA) $(XFLAGS)
LDFLAGS= $(LDDEBUG) @LDFLAGS@
endif
ifeq (gcc,$(findstring gcc,$(CC)))
ifeq ("linux","@build_os@")
LDFLAGS+= -rdynamic
endif
endif
LDLIBS= -L$(D_LIB) @LDLIBS@ @LIBS@ @LIBMALLOC@ @EXTRALIBS@
YFLAGS= -d
ARFLAGS= rcv
RMFLAGS= -f
RMDFLAGS= -rf
#########################################################################################
# Targets
LIBROOT= misc
LIBOBJS=\
$(D_OBJ)/edassert$(O) \
$(D_OBJ)/edtrace$(O) \
$(D_OBJ)/edbt_win32$(O) \
$(D_OBJ)/edbt_linux$(O) \
$(D_OBJ)/edbt_unix$(O) \
\
$(D_OBJ)/strcompare$(O) \
$(D_OBJ)/strconvert$(O) \
$(D_OBJ)/strcopy$(O) \
$(D_OBJ)/strerror$(O) \
$(D_OBJ)/strlen$(O) \
$(D_OBJ)/strnum$(O) \
$(D_OBJ)/strparse$(O) \
$(D_OBJ)/strprint$(O) \
$(D_OBJ)/strtok$(O) \
$(D_OBJ)/strtrim$(O) \
$(D_OBJ)/strutil$(O) \
\
$(D_OBJ)/env$(O) \
$(D_OBJ)/patmatch$(O) \
$(D_OBJ)/crc32$(O) \
$(D_OBJ)/iniparser$(O) \
\
$(D_OBJ)/refobj$(O) \
$(D_OBJ)/stable$(O) \
$(D_OBJ)/stype$(O) \
$(D_OBJ)/vtype$(O) \
\
$(D_OBJ)/chkalloc$(O) \
$(D_OBJ)/vm_alloc$(O) \
$(D_OBJ)/rb$(O) \
$(D_OBJ)/ringbuf$(O) \
\
$(D_OBJ)/edthreads_win32$(O) \
$(D_OBJ)/edthreads_pthread$(O) \
\
$(D_OBJ)/timespec$(O) \
$(D_OBJ)/timeget$(O) \
$(D_OBJ)/timegm$(O) \
$(D_OBJ)/timegetutc$(O) \
$(D_OBJ)/timehttp$(O) \
\
$(D_OBJ)/getopt$(O) \
$(D_OBJ)/getopt_common$(O) \
\
$(D_OBJ)/bsd_cdbr$(O) \
$(D_OBJ)/bsd_cdbw$(O) \
$(D_OBJ)/bsd_mivhash$(O) \
$(D_OBJ)/bsd_getoptl$(O) \
$(D_OBJ)/bsd_glob$(O) \
$(D_OBJ)/bsd_heapsort$(O) \
$(D_OBJ)/bsd_heapsort_r$(O) \
$(D_OBJ)/bsd_mergesort$(O) \
$(D_OBJ)/bsd_mergesort_r$(O) \
$(D_OBJ)/bsd_qsort$(O) \
$(D_OBJ)/bsd_qsort_r$(O) \
$(D_OBJ)/bsd_radixsort$(O)
# $(D_OBJ)/bsd_fts$(O) \
LIBRARY= $(D_LIB)/$(LP)$(LIBROOT)$(A)
#########################################################################################
# Rules
.PHONY: build release debug
build: $(LIBRARY)
release:
$(MAKE) BUILD_TYPE=release $(filter-out release, $(MAKECMDGOALS))
debug:
$(MAKE) BUILD_TYPE=debug $(filter-out debug, $(MAKECMDGOALS))
$(LIBRARY): $(D_OBJ)/.created $(LIBOBJS)
$(RM) $(RMFLAGS) $@
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
$(RANLIB) $@
$(D_OBJ)/.created:
-@mkdir $(D_OBJ)
@echo "do not create" > $@
clean:
-@$(RM) $(RMFLAGS) $(BAK) $(LIBRARY) $(LIBOBJS) $(CLEAN) $(XCLEAN) >/dev/null 2>&1
$(D_OBJ)/%$(O): %$(C)
$(CC) $(CFLAGS) -o $@ -c $<
#end