-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
65 lines (48 loc) · 1.89 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
#2003,2010 Stephen Melvin Jr <[email protected]>
NASM = nasm
MAFLAGS = --prefix _ -f macho
LAFLAGS = -f elf32
CC = gcc
#CFLAGS = -W -Wall -pedantic -g
MCFLAGS = -m32 -W -Wall -pedantic -framework CoreServices -framework AudioToolbox -framework CoreAudio -framework AudioUnit
LCFLAGS = -m32 -W -Wall -pedantic
SPC_IMPL = SNEeSe
SPCIMPL_OBJS = SNEeSe/SPC700.o SNEeSe/SPCimpl.o
LIB_OBJS = main.o dsp.o $(SPCIMPL_OBJS)
INSTALL_PATH = /usr/local
INSTALL_BIN_PATH = $(INSTALL_PATH)/bin
INSTALL_LIB_PATH = $(INSTALL_PATH)/lib
INSTALL_INC_PATH = $(INSTALL_PATH)/include
osx: CFLAGS = $(MCFLAGS)
osx: AFLAGS = $(MAFLAGS)
osx: SPCPLAYERFILE = spcplayerosx.c
osx: spcplayer
linux: CFLAGS = $(LCFLAGS)
linux: AFLAGS = $(LAFLAGS)
linux: SPCPLAYERFILE = spcplayerlinux.c
linux: spcplayer
spcplayer: libopenspc.a $(SPCPLAYERFILE)
$(CC) $(CFLAGS) $(SPCPLAYERFILE) -o spcplayer libopenspc.a -lz
#install: libopenspc.so openspc.h
# mkdir -p $(INSTALL_LIB_PATH) $(INSTALL_INC_PATH)
# install -m 755 libopenspc.so $(INSTALL_LIB_PATH)/libopenspc.so
# install -m 755 openspc.h $(INSTALL_INC_PATH)/openspc.h
install: soap
install -m 755 soap /usr/local/bin/soap
libopenspc.a:: libopenspc.a($(LIB_OBJS))
#libopenspc.so: $(LIB_OBJS)
# gcc $(LIB_OBJS) -o $@ -shared
main.o: main.c openspc.h dsp.h $(SPC_IMPL)/SPCimpl.h Makefile
$(CC) $(CFLAGS) -I$(SPC_IMPL) -c main.c -o main.o
dsp.o: dsp.c dsp.h gauss.h $(SPC_IMPL)/SPCimpl.h Makefile
$(CC) $(CFLAGS) -I$(SPC_IMPL) -c dsp.c -o dsp.o
$(SPC_IMPL)/SPCimpl.o: $(SPC_IMPL)/SPCimpl.c dsp.h Makefile
$(CC) $(CFLAGS) -I. -c $(SPC_IMPL)/SPCimpl.c -o $(SPC_IMPL)/SPCimpl.o
SNEeSe/SPC700.o: SNEeSe/SPC700.asm SNEeSe/spc.ni SNEeSe/regs.ni \
SNEeSe/spcaddr.ni SNEeSe/spcmacro.ni SNEeSe/spcops.ni SNEeSe/misc.ni \
Makefile
$(NASM) $(AFLAGS) -iSNEeSe/ -o SNEeSe/SPC700.o SNEeSe/SPC700.asm
clean:
rm -f *.o $(SPC_IMPL)/*.o libopenspc.a soap spcplayer
uninstall:
rm -f /usr/local/bin/soap