forked from craigsapp/midifile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
97 lines (76 loc) · 2.55 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
##
## Main GNU makefile for Midifile library.
##
## Programmer: Craig Stuart Sapp <[email protected]>
## 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, use visual-studio/midifile.sln
## Do not use this Makefile
##############################
##
## Targets:
##
# targets which don't actually refer to files
.PHONY : all info library examples 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
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 $@