-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
492 lines (390 loc) · 14.8 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
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
##
## Programmer: Craig Stuart Sapp <[email protected]>
## Creation Date: Sun Aug 9 22:20:14 PDT 2015
## Last Modified: Sat Jun 17 00:14:11 CEST 2017
## Syntax: GNU Makefile
## Filename: humlib/Makefile
## vim: ts=3
##
## Description: Makefile to run tasks for humlib library.
##
## To compile the humlib library with the Options class, run:
## make CFLAGS=-D_INCLUDE_HUMLIB_OPTIONS_
## Otherwise to compile:
## make
## To create the minimal file version:
## make min
##
# Set the environmental variable $MACOSX_DEPLOYMENT_TARGET to
# "10.9" in Apple OS X to compile for OS X 10.9 and later (for example,
# you can compile for OS X 10.9 computers even if you are using the 10.10
# version of the operating system).
ENV =
OS := $(shell uname -s)
ifeq ($(OS),Darwin)
OS = OSX
# Minimum OS X Version for C++11 is OS X 10.9:
ENV = MACOSX_DEPLOYMENT_TARGET=10.9
# use the following to compile for 32-bit architecture on 64-bit comps:
#ARCH = -m32 -arch i386
else
# use the following to compile for 32-bit architecture on 64-bit comps:
# (you will need 32-bit libraries in order to do this)
# ARCH = -m32
endif
###########################################################################
# #
# Beginning of user-modifiable configuration variables #
# #
BINDIR = bin
OBJDIR = obj
SRCDIR = src
TOOLDIR = cli
SRCDIR_MIN = src
INCDIR = include
INCDIR_MIN = include
LIBDIR = lib
LIBFILE = libhumdrum.a
LIBFILE_MIN = libhumlib.a
#DYLIBFILE = libhumlib.dylib
LIBFILE_PUGI = libpugixml.a
DLIBFILE = libhumdrum.a
DLIBFILE_MIN = libhumlib.a
ifeq ($(OS),OSX)
DLIBFILE_MIN = humlib.dylib
else
DLIBFILE_MIN = humlib.so
endif
AR = ar
RANLIB = ranlib
PREFLAGS = -c -g $(CFLAGS) $(DEFINES) -I$(INCDIR)
PREFLAGS += -O3 -Wall
# using C++ 2011 standard in Humlib:
PREFLAGS += -std=c++11
# Add -static flag to compile without dynamics libraries for better portability:
POSTFLAGS =
# POSTFLAGS += -static
ifeq ($(CXX),)
COMPILER = LANG=C $(ENV) g++ $(ARCH)
else
COMPILER = LANG=C $(ENV) $(CXX) $(ARCH)
endif
# Or use clang++ v3.3:
#COMPILER = clang++
#PREFLAGS += -stdlib=libc++
# #
# End of user-modifiable variables. #
# #
###########################################################################
# setting up the directory paths to search for dependency files
vpath %.h $(INCDIR):$(SRCDIR)
vpath %.cpp $(SRCDIR):$(INCDIR)
vpath %.o $(OBJDIR)
# generating a list of the object files
OBJS =
OBJS += $(notdir $(patsubst %.cpp,%.o,$(wildcard $(SRCDIR)/tool-*.cpp)))
OBJS += $(notdir $(patsubst %.cpp,%.o,$(wildcard $(SRCDIR)/[A-Z]*.cpp)))
# targets which don't actually refer to files
.PHONY: examples myprograms src include dynamic cli
###########################################################################
all: pugixml library tools
update:
git checkout src/humlib.cpp
git checkout include/humlib.h
git pull
pugi: pugixml
pugixml: makedirs pugixml.o
@-rm -f $(LIBDIR)/$(LIBFILE_PUGI)
@$(AR) r $(LIBDIR)/$(LIBFILE_PUGI) $(OBJDIR)/pugixml.o
@$(RANLIB) $(LIBDIR)/$(LIBFILE_PUGI)
dynamic: min
ifeq ($(OS),OSX)
g++ -dynamiclib -o $(LIBDIR)/$(DLIBFILE_MIN) $(OBJDIR)/humlib.o
else
g++ -shared -fPIC -o $(LIBDIR)/$(DLIBFILE_MIN) $(OBJDIR)/humlib.o
endif
library: minlibrary
minlib: minlibrary
minlibrary: makedirs min humlib.o
@-rm -f $(LIBDIR)/$(LIBFILE_MIN)
@$(AR) r $(LIBDIR)/$(LIBFILE_MIN) $(OBJDIR)/humlib.o
@$(RANLIB) $(LIBDIR)/$(LIBFILE_MIN)
# @$(COMPILER) -dynamiclib -o $(LIBDIR)/$(DYLIBFILE) $(OBJDIR)/humlib.o $(OBJDIR)/pugixml.o
lib: makedirs $(OBJS)
@-rm -f $(LIBDIR)/$(LIBFILE)
@$(AR) r $(LIBDIR)/$(LIBFILE) $(addprefix $(OBJDIR)/, $(OBJS))
@$(RANLIB) $(LIBDIR)/$(LIBFILE)
cli: tools
tool: tools
tools:
@$(MAKE) -f Makefile.programs
min:
bin/makehumlib
clean:
@echo Erasing object files...
@-rm -f $(OBJDIR)/*.o
@echo Erasing obj directory...
@-rmdir $(OBJDIR)
superclean: clean
-rm -rf $(LIBDIR)
-rm -f $(BINDIR)/test*
makedirs:
@-mkdir -p $(OBJDIR)
@-mkdir -p $(LIBDIR)
%:
@echo 'if [ "$<" == "" ]; then $(MAKE) -f Makefile.programs $@; fi' | bash -s
pugixml.o: pugixml.cpp
@echo [CC] $@
@$(COMPILER) $(PREFLAGS) -o $(OBJDIR)/$(notdir $@) $(POSTFLAGS) $<
###########################################################################
# #
# defining an explicit rule for object file dependencies #
# #
%.o : %.cpp min
@echo [CC] $@
@$(COMPILER) $(PREFLAGS) -o $(OBJDIR)/$(notdir $@) $(POSTFLAGS) $<
# #
###########################################################################
###########################################################################
# #
# Dependencies -- generated with the following command in #
# the src directory (in bash shell): #
# #
# for i in src/*.cpp
# do
# cc -std=c++11 -Iinclude -MM $i | sed 's/include\///g; s/src\///g'
# echo ""
# done
#
Convert-kern.o: Convert-kern.cpp Convert.h HumNum.h \
HumdrumToken.h HumAddress.h HumHash.h
Convert-math.o: Convert-math.cpp Convert.h HumNum.h \
HumdrumToken.h HumAddress.h HumHash.h
Convert-pitch.o: Convert-pitch.cpp Convert.h HumNum.h \
HumdrumToken.h HumAddress.h HumHash.h
Convert-rhythm.o: Convert-rhythm.cpp Convert.h \
HumNum.h HumdrumToken.h HumAddress.h \
HumHash.h
Convert-string.o: Convert-string.cpp Convert.h \
HumNum.h HumdrumToken.h HumAddress.h \
HumHash.h HumRegex.h
GridMeasure.o: GridMeasure.cpp HumGrid.h \
GridMeasure.h GridCommon.h HumdrumFile.h \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
GridSlice.h MxmlPart.h MxmlMeasure.h \
GridPart.h \
GridStaff.h GridSide.h GridVoice.h
GridPart.o: GridPart.cpp GridPart.h GridStaff.h \
GridCommon.h GridSide.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
GridVoice.h
GridSide.o: GridSide.cpp HumGrid.h GridMeasure.h \
GridCommon.h HumdrumFile.h \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
GridSlice.h MxmlPart.h MxmlMeasure.h \
GridPart.h \
GridStaff.h GridSide.h GridVoice.h
GridSlice.o: GridSlice.cpp HumGrid.h GridMeasure.h \
GridCommon.h HumdrumFile.h \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
GridSlice.h MxmlPart.h MxmlMeasure.h \
GridPart.h \
GridStaff.h GridSide.h GridVoice.h
GridStaff.o: GridStaff.cpp HumGrid.h GridMeasure.h \
GridCommon.h HumdrumFile.h \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
GridSlice.h MxmlPart.h MxmlMeasure.h \
GridPart.h \
GridStaff.h GridSide.h GridVoice.h
GridVoice.o: GridVoice.cpp GridVoice.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h
HumAddress.o: HumAddress.cpp HumAddress.h \
HumdrumLine.h HumdrumToken.h HumNum.h \
HumHash.h
HumGrid.o: HumGrid.cpp HumGrid.h GridMeasure.h \
GridCommon.h HumdrumFile.h \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
GridSlice.h MxmlPart.h MxmlMeasure.h \
GridPart.h \
GridStaff.h GridSide.h GridVoice.h \
Convert.h
HumHash.o: HumHash.cpp HumHash.h HumNum.h \
Convert.h HumdrumToken.h HumAddress.h
HumInstrument.o: HumInstrument.cpp HumInstrument.h
HumNum.o: HumNum.cpp HumNum.h
HumRegex.o: HumRegex.cpp HumRegex.h
HumTool.o: HumTool.cpp HumTool.h Options.h
HumdrumFile.o: HumdrumFile.cpp HumdrumFile.h \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
Convert.h
HumdrumFileBase-net.o: HumdrumFileBase-net.cpp \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
Convert.h
HumdrumFileBase.o: HumdrumFileBase.cpp HumdrumFileBase.h \
HumdrumLine.h HumdrumToken.h HumNum.h \
HumAddress.h HumHash.h Convert.h \
HumRegex.h
HumdrumFileContent-accidental.o: HumdrumFileContent-accidental.cpp \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
Convert.h
HumdrumFileContent-metlev.o: HumdrumFileContent-metlev.cpp \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
Convert.h
HumdrumFileContent-slur.o: HumdrumFileContent-slur.cpp \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h
HumdrumFileContent-tie.o: HumdrumFileContent-tie.cpp \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h
HumdrumFileContent-timesig.o: HumdrumFileContent-timesig.cpp \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
Convert.h
HumdrumFileContent.o: HumdrumFileContent.cpp \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h
HumdrumFileStream.o: HumdrumFileStream.cpp \
HumdrumFileStream.h HumdrumFile.h \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
Options.h HumRegex.h
HumdrumFileStructure.o: HumdrumFileStructure.cpp \
HumdrumFileStructure.h HumdrumFileBase.h \
HumdrumLine.h HumdrumToken.h HumNum.h \
HumAddress.h HumHash.h Convert.h
HumdrumLine.o: HumdrumLine.cpp HumdrumLine.h \
HumdrumToken.h HumNum.h HumAddress.h \
HumHash.h HumdrumFile.h HumdrumFileContent.h \
HumdrumFileStructure.h HumdrumFileBase.h \
Convert.h
HumdrumToken.o: HumdrumToken.cpp HumAddress.h \
HumdrumToken.h HumNum.h HumHash.h \
HumdrumLine.h HumdrumFile.h \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h Convert.h
MxmlEvent.o: MxmlEvent.cpp MxmlEvent.h GridCommon.h \
HumNum.h MxmlMeasure.h
MxmlMeasure.o: MxmlMeasure.cpp MxmlEvent.h \
GridCommon.h HumNum.h \
MxmlMeasure.h MxmlPart.h
MxmlPart.o: MxmlPart.cpp MxmlMeasure.h GridCommon.h \
HumNum.h MxmlPart.h
NoteCell.o: NoteCell.cpp NoteCell.h HumdrumFile.h \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
NoteGrid.h Convert.h
NoteGrid.o: NoteGrid.cpp NoteGrid.h NoteCell.h \
HumdrumFile.h HumdrumFileContent.h \
HumdrumFileStructure.h HumdrumFileBase.h \
HumdrumLine.h HumdrumToken.h HumNum.h \
HumAddress.h HumHash.h HumRegex.h
Options.o: Options.cpp Options.h
humlib.o: humlib.cpp humlib.h
pugixml.o: pugixml.cpp
tool-autobeam.o: tool-autobeam.cpp tool-autobeam.h \
HumTool.h Options.h HumdrumFile.h \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h
tool-autostem.o: tool-autostem.cpp tool-autostem.h \
HumTool.h Options.h HumdrumFile.h \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
HumRegex.h Convert.h
tool-cint.o: tool-cint.cpp tool-cint.h HumTool.h \
Options.h HumdrumFile.h HumdrumFileContent.h \
HumdrumFileStructure.h HumdrumFileBase.h \
HumdrumLine.h HumdrumToken.h HumNum.h \
HumAddress.h HumHash.h NoteGrid.h \
NoteCell.h HumRegex.h Convert.h
tool-dissonant.o: tool-dissonant.cpp tool-dissonant.h \
HumTool.h Options.h HumdrumFile.h \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
NoteGrid.h NoteCell.h Convert.h \
HumRegex.h
tool-esac2hum.o: tool-esac2hum.cpp tool-esac2hum.h \
HumTool.h Options.h HumdrumFile.h \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
Convert.h
tool-extract.o: tool-extract.cpp tool-extract.h \
HumTool.h Options.h HumdrumFile.h \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
HumRegex.h
tool-filter.o: tool-filter.cpp tool-filter.h \
HumTool.h Options.h HumdrumFile.h \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
tool-autobeam.h tool-autostem.h tool-cint.h \
NoteGrid.h NoteCell.h HumRegex.h \
tool-dissonant.h tool-extract.h tool-recip.h \
tool-satb2gs.h tool-metlev.h tool-myank.h \
tool-transpose.h
tool-metlev.o: tool-metlev.cpp tool-metlev.h \
HumTool.h Options.h HumdrumFile.h \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
Convert.h
tool-musicxml2hum.o: tool-musicxml2hum.cpp \
tool-musicxml2hum.h Options.h HumTool.h \
MxmlPart.h MxmlMeasure.h GridCommon.h HumNum.h \
MxmlEvent.h HumGrid.h GridMeasure.h \
HumdrumFile.h HumdrumFileContent.h \
HumdrumFileStructure.h HumdrumFileBase.h \
HumdrumLine.h HumdrumToken.h HumAddress.h \
HumHash.h GridSlice.h GridPart.h \
GridStaff.h GridSide.h GridVoice.h
tool-myank.o: tool-myank.cpp tool-myank.h HumTool.h \
Options.h HumdrumFile.h HumdrumFileContent.h \
HumdrumFileStructure.h HumdrumFileBase.h \
HumdrumLine.h HumdrumToken.h HumNum.h \
HumAddress.h HumHash.h HumRegex.h
tool-recip.o: tool-recip.cpp tool-recip.h HumTool.h \
Options.h HumdrumFile.h HumdrumFileContent.h \
HumdrumFileStructure.h HumdrumFileBase.h \
HumdrumLine.h HumdrumToken.h HumNum.h \
HumAddress.h HumHash.h Convert.h \
HumRegex.h
tool-satb2gs.o: tool-satb2gs.cpp tool-satb2gs.h \
HumTool.h Options.h HumdrumFile.h \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
HumRegex.h Convert.h
tool-transpose.o: tool-transpose.cpp tool-transpose.h \
HumTool.h Options.h HumdrumFile.h \
HumdrumFileContent.h HumdrumFileStructure.h \
HumdrumFileBase.h HumdrumLine.h HumdrumToken.h \
HumNum.h HumAddress.h HumHash.h \
Convert.h HumRegex.h