aboutsummaryrefslogtreecommitdiff
path: root/lib/asap/Makefile.in
blob: 782c46d1d184c3fdd83e3c7d6d725ddf3e387ebb (plain)
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
PREFIX = /usr/local

CC = gcc -s -O2 -Wall -fPIC
AR = ar rc
PERL = perl
XASM = xasm/xasm -q
MADS = mads/mads -s
RM = rm -f
MKDIRS = mkdir -p
INSTALL = install
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644
ASCIIDOC = asciidoc -a localtime -a doctime
ASCIIDOC_POSTPROCESS = $(PERL) -pi -e 's/527bbd;/c02020;/'

XMMS_CFLAGS = `xmms-config --cflags`
XMMS_LIBS = `xmms-config --libs`
XMMS_INPUT_PLUGIN_DIR = `xmms-config --input-plugin-dir`
XMMS_USER_PLUGIN_DIR = $(HOME)/.xmms/Plugins
MOC_INCLUDE = ../moc-2.4.4
MOC_PLUGIN_DIR = /usr/local/lib/moc/decoder_plugins
XBMC_DLL_LOADER_EXPORTS = @abs_top_srcdir@/src/cores/DllLoader/exports

COMMON_C = asap.c acpu.c apokeysnd.c
COMMON_H = asap.h asap_internal.h anylang.h players.h
COMMON_O = asap.o acpu.o apokeysnd.o
PLAYERS_OBX = players/cmc.obx players/cm3.obx players/cms.obx players/dlt.obx players/mpt.obx players/rmt4.obx players/rmt8.obx players/tmc.obx players/tm2.obx

.PHONY: force

all: asap2wav libasap.a

asap2wav: asap2wav.c $(COMMON_C) $(COMMON_H)
	$(CC) -o $@ -I. asap2wav.c $(COMMON_C)

lib: libasap.a

libasap.a: $(COMMON_C) $(COMMON_H)
	$(CC) -c -I. $(COMMON_C)
	$(AR) $@ asap.o acpu.o apokeysnd.o

asap-xmms: libasap-xmms.so

libasap.xmms.so: xmms/libasap-xmms.c $(COMMON_C) $(COMMON_H)
	$(CC) $(XMMS_CFLAGS) -shared -fPIC -Wl,--version-script=xmms/libasap-xmms.map -o $@ -I. xmms/libasap-xmms.c $(COMMON_C) $(XMMS_LIBS)

asap-moc: libasap_decoder.so

libasap_decoder.so: moc/libasap_decoder.c $(COMMON_C) $(COMMON_H)
	$(CC) -shared -fPIC -o $@ -I. -I$(MOC_INCLUDE) moc/libasap_decoder.c $(COMMON_C)

asap-xbmc: mads/mads xasm/xasm @abs_top_srcdir@/system/players/paplayer/xbmc_asap-@ARCH@.so

src/xbmc_asap.o: src/xbmc_asap.c
	$(CC) -I. -O2 -o $@ -c src/xbmc_asap.c

asap.o: asap.c $(COMMON_H)
	$(CC) -I. -O2 -o $@ -c asap.c

acpu.o: acpu.c $(COMMON_H)
	$(CC) -I. -O2 -o $@ -c acpu.c

apokeysnd.o: apokeysnd.c
	$(CC) -I. -O2 -o $@ -c apokeysnd.c

@abs_top_srcdir@/system/players/paplayer/xbmc_asap-@ARCH@.so: src/xbmc_asap.o $(COMMON_O) $(COMMON_H)
	$(CC) -shared -fPIC -o $@ -I. src/xbmc_asap.o `cat $(XBMC_DLL_LOADER_EXPORTS)/wrapper.def` $(XBMC_DLL_LOADER_EXPORTS)/wrapper.o $(COMMON_O)

players.h: files2anylang.pl $(PLAYERS_OBX)
	$(PERL) files2anylang.pl $(PLAYERS_OBX) >$@

mads/mads: force
	make -C mads

xasm/xasm: force
	make -C xasm GDC=@HAVE_GDC@

players/cmc.obx: players/cmc.asx xasm/xasm
	$(XASM) -d CM3=0 -o $@ players/cmc.asx

players/cm3.obx: players/cmc.asx xasm/xasm
	$(XASM) -d CM3=1 -o $@ players/cmc.asx

players/cms.obx: players/cms.asx xasm/xasm
	$(XASM) -o $@ players/cms.asx

players/dlt.obx: players/dlt.as8 mads/mads
	$(MADS) -o:$@ -c players/dlt.as8

players/mpt.obx: players/mpt.asx xasm/xasm
	$(XASM) -o $@ players/mpt.asx

players/rmt4.obx: players/rmt.asx xasm/xasm
	$(XASM) -d STEREOMODE=0 -o $@ players/rmt.asx

players/rmt8.obx: players/rmt.asx xasm/xasm
	$(XASM) -d STEREOMODE=1 -o $@ players/rmt.asx

players/tmc.obx: players/tmc.asx xasm/xasm
	$(XASM) -o $@ players/tmc.asx

players/tm2.obx: players/tm2.asx xasm/xasm
	$(XASM) -o $@ players/tm2.asx

install: install-asap2wav install-lib

install-asap2wav: asap2wav
	$(MKDIRS) $(PREFIX)/bin
	$(INSTALL_PROGRAM) asap2wav $(PREFIX)/bin/asap2wav

uninstall-asap2wav:
	$(RM) $(PREFIX)/bin/asap2wav

install-lib: libasap.a
	$(MKDIRS) $(PREFIX)/include
	$(INSTALL_DATA) asap.h $(PREFIX)/include/asap.h
	$(MKDIRS) $(PREFIX)/lib
	$(INSTALL_DATA) libasap.a $(PREFIX)/lib/libasap.a

uninstall-lib:
	$(RM) $(PREFIX)/include/asap.h $(PREFIX)/lib/libasap.a

install-xmms: libasap-xmms.so
	$(MKDIRS) $(XMMS_INPUT_PLUGIN_DIR)
	$(INSTALL_PROGRAM) libasap-xmms.so $(XMMS_INPUT_PLUGIN_DIR)/libasap-xmms.so

uninstall-xmms:
	$(RM) $(XMMS_INPUT_PLUGIN_DIR)/libasap-xmms.so

install-xmms-user: libasap-xmms.so
	$(MKDIRS) $(XMMS_USER_PLUGIN_DIR)
	$(INSTALL_PROGRAM) libasap-xmms.so $(XMMS_USER_PLUGIN_DIR)/libasap-xmms.so

uninstall-xmms-user:
	$(RM) $(XMMS_USER_PLUGIN_DIR)/libasap-xmms.so

install-moc: libasap_decoder.so
	$(MKDIRS) $(MOC_PLUGIN_DIR)
	$(INSTALL_PROGRAM) libasap_decoder.so $(MOC_PLUGIN_DIR)/libasap_decoder.so

uninstall-moc:
	$(RM) $(MOC_PLUGIN_DIR)/libasap_decoder.so

players-clean:
	make -C players clean
	make -C mads clean
	make -C xasm clean

distclean: clean

clean: players-clean
	$(RM) asap2wav libasap.a asap.o acpu.o apokeysnd.o libasap-xmms.so libasap_decoder.so @abs_top_srcdir@/system/players/paplayer/xbmc_asap-@ARCH@.so players.h src/xbmc_asap.o

README.html: README INSTALL NEWS CREDITS
	$(ASCIIDOC) -o $@ -a asapsrc -a asapports README
	$(ASCIIDOC_POSTPROCESS) $@

.DELETE_ON_ERROR: