File: Makefile

package info (click to toggle)
playmidi 2.3-22
  • links: PTS
  • area: main
  • in suites: slink
  • size: 444 kB
  • ctags: 272
  • sloc: ansic: 2,569; makefile: 172; sh: 81; sed: 2
file content (160 lines) | stat: -rw-r--r-- 4,716 bytes parent folder | download
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
###########################################################################
# playmidi Makefile  last modification 2 January 1996
#
# by Nathan I Laredo, laredo@gnu.ai.mit.edu
#
# I don't wish to assert any rights (copyright) for this Makefile.
# This Makefile is specially designed for using "make install"
# thousands of times (for developing), and will only install updated
# files.  It does not write over exiting fm patch libs if you have them.
#
# 5/10/95 - Fixed a few bugs here and there. -- Alex
#
# 9/15/95 - Changed back to what I originally intended.
#
# 10/5/95 - Moved configurables to the start of Makefile, made variables
#           Added install for patch libraries
#
# 12/9/95 - Added stuff for xplaymidi, modified default paths for FSSTND
#           Any RedHat system should compile as is.
#
# 1/2/96  - Tried to document more completely, added some more objects
#           install.noX11, install.novga, install.Xonly, install.lame
#
# 1/5/96  - Added -DNARROWPROTO for xplaymidi
#
# 1/28/96 - Added options to make xview and xforms versions of xplaymidi
###########################################################################

# ncurses usually /usr/lib, -L/usr/local/lib doesn't hurt
# unless there's more than one ncurses floating around on your system
LIBNC	= -L/usr/local/lib -lncurses

######### NOTE:  X11R6 or newer REQUIRED
LIBX11	= -L/usr/X11R6/lib -lXaw -lXmu -lXt -lX11 -lXext -lSM -lICE
LIBVGA	= -L/usr/local/lib -lvgagl -lvga

# ncurses is usually in /usr/include/ncurses, but you may need
# to use /usr/local/include/ncurses depending on your setup.
INCNC	= -I/usr/include/ncurses

# just in case you keep your X includes in an odd location.
INCX11	= -I/usr/X11R6/include -DNARROWPROTO

# usually in /usr/include, but -I/usr/local/include doesn't hurt
# unless there's more than one svgalib floating around your system.
INCVGA	= -I/usr/local/include

# Directory where application defaults files are stored for X11 version
XAPPDEFAULTS = /usr/X11R6/lib/X11/app-defaults

INCLUDES= $(INCNC) $(INCX11) $(INCVGA)
INSTALLDIR = /usr/bin
INSTALL = install -s

# if you are using the GUS Ultra driver module, add -DULTRA_DRIVER
CFLAGS	= -Wall -pipe -fomit-frame-pointer -O2
LDFLAGS =

OBJECTS = playmidi.o readmidi.o playevents.o \
	  patchload.o emumidi.o io_ncurses.o

XOBJECTS= playmidi.o readmidi.o playevents.o \
	  patchload.o emumidi.o io_xaw.o

SOBJECTS= playmidi.o readmidi.o playevents.o \
	  patchload.o emumidi.o io_svgalib.o

all: playmidi splaymidi xplaymidi

config:
playmidi.h: playmidi.h-dist
	./Configure

io_ncurses.o: io_ncurses.c
	$(CC) $(CFLAGS) $(INCNC) -c io_ncurses.c -o io_ncurses.o

io_xaw.o: io_xaw.c
	$(CC) $(CFLAGS) $(INCX11) -c io_xaw.c -o io_xaw.o

io_svgalib.o: io_svgalib.c
	$(CC) $(CFLAGS) $(INCVGA) -c io_svgalib.c -o io_svgalib.o

playmidi: .depend $(OBJECTS)
	$(CC) $(LDFLAGS) -o playmidi $(OBJECTS) $(LIBNC)

xplaymidi: .depend $(XOBJECTS)
	$(CC) $(LDFLAGS) -o xplaymidi $(XOBJECTS) $(LIBX11)

splaymidi: .depend $(SOBJECTS)
	$(CC) $(LDFLAGS) -o splaymidi $(SOBJECTS) $(LIBVGA)

$(INSTALLDIR)/playmidi: playmidi
	$(INSTALL) playmidi $(INSTALLDIR)

$(INSTALLDIR)/xplaymidi: xplaymidi
	$(INSTALL) xplaymidi $(INSTALLDIR)

$(INSTALLDIR)/splaymidi: splaymidi
	$(INSTALL) splaymidi $(INSTALLDIR)

/etc/std.o3:
	cp -i std.o3 /etc

/etc/drums.o3:
	cp -i drums.o3 /etc

/etc/std.sb:
	cp -i std.sb /etc

/etc/drums.sb:
	cp -i drums.sb /etc

$(XAPPDEFAULTS)/XPlaymidi:
	cp -i XPlaymidi.ad $(XAPPDEFAULTS)/XPlaymidi

install: $(INSTALLDIR)/playmidi $(INSTALLDIR)/splaymidi \
	 $(INSTALLDIR)/xplaymidi /etc/std.o3 /etc/drums.o3 \
	 /etc/std.sb /etc/drums.sb $(XAPPDEFAULTS)/XPlaymidi

install.novga: $(INSTALLDIR)/playmidi \
	 $(INSTALLDIR)/xplaymidi /etc/std.o3 /etc/drums.o3 \
	 /etc/std.sb /etc/drums.sb $(XAPPDEFAULTS)/XPlaymidi

install.noX11: $(INSTALLDIR)/playmidi $(INSTALLDIR)/splaymidi \
	 /etc/std.o3 /etc/drums.o3 /etc/std.sb /etc/drums.sb

install.Xonly: $(INSTALLDIR)/xplaymidi /etc/std.o3 /etc/drums.o3 \
	 /etc/std.sb /etc/drums.sb $(XAPPDEFAULTS)/XPlaymidi

install.lame: $(INSTALLDIR)/playmidi \
	 /etc/std.o3 /etc/drums.o3 /etc/std.sb /etc/drums.sb

install.man:
	 cp playmidi.1 /usr/man/man1/

clean:
	rm -f *.o playmidi splaymidi xplaymidi a.out

distclean: clean
	rm -f .depend  *~ *.bak playmidi.h config.sed


ifeq (.depend, $(wildcard .depend))
.depend depend dep: playmidi.h
	for i in *.c; do $(CPP) -M $(CFLAGS) $(INCLUDES) $$i; done >.depend

include .depend
else
depend dep:
	for i in *.c; do $(CPP) -M $(CFLAGS) $(INCLUDES) $$i; done >.depend

.depend: playmidi.h
	@echo
	@echo "Bad or missing .depend running 'make depend clean'"
	@echo
	$(MAKE) depend clean
	@echo
	@echo "Successful.  Trying to make again"
	@exit 0
endif