-
Notifications
You must be signed in to change notification settings - Fork 138
/
Makefile
103 lines (80 loc) · 2.63 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
##
## Main GNU makefile for Midifile library.
##
## Programmer: Craig Stuart Sapp <craig@ccrma.stanford.edu>
## Creation Date: Sun Apr 3 00:44:44 PST 2005
## Last Modified: Mon Feb 9 12:59:54 PST 2015
## Filename: midifile/Makefile
## Website: http://midifile.sapp.org
## Syntax: GNU Makefile
## Description: This Makefile can create the Midifile library and/or
## example programs which use the Midifile library.
##
## To run this makefile, type:
## make library
## then:
## make programs
## Or type:
## make
## to compile both the library and the programs at the same time.
##
## NB: To build on Windows with Visual Studio, use visual-studio/midifile.sln
## instead of this Makefile.
##
##############################
##
## Targets:
##
# targets which don't actually refer to files
.PHONY : all info library tools programs bin options clean lib
all: info library programs lib
info:
@echo ""
@echo This makefile will compile the Midifile library and/or
@echo the Midifile programs. You may have to make the library
@echo first if compiling the programs. Type one of the following:
@echo " make library"
@echo or
@echo " make programs"
@echo ""
@echo To compile a specific program called xxx, type:
@echo " make xxx"
@echo ""
@echo Typing \"make\" alone will compile both the library and all programs.
@echo ""
lib: library
library:
$(MAKE) -f Makefile.library
clean:
$(MAKE) -f Makefile.library clean
-rm -rf bin
-rm -rf lib
readme:
(cd tools; ./.makeReadme)
tools: programs
bin: programs
examples: programs
programs:
$(MAKE) -f Makefile.programs
options:
# The Options class is borrowed from optionlib:
# https://github.com/craigsapp/optionlib
# This code downloads the most recent version of the Option class, and the
# Option class should not be modified within this library. The Option
# class is only needed by some of the example programs. It is not
# necessary if you only want to use the compiled MidiFile library.
ifneq ($(shell which wget),)
wget https://raw.githubusercontent.com/craigsapp/optionlib/master/src/Options.cpp -O src/Options.cpp
wget https://raw.githubusercontent.com/craigsapp/optionlib/master/include/Options.h -O include/Options.h
else ifneq ($(shell which curl),)
curl https://raw.githubusercontent.com/craigsapp/optionlib/master/src/Options.cpp -o src/Options.cpp
curl https://raw.githubusercontent.com/craigsapp/optionlib/master/include/Options.h -O include/Options.h
endif
##############################
##
## Default target: compile a particular program:
##
%:
@-mkdir -p bin
@echo compiling file $@
$(MAKE) -f Makefile.programs $@