File: Makefile

package info (click to toggle)
fenix-plugins 0.0.20070803-5
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 36,452 kB
  • sloc: sh: 8,736; ansic: 3,026; xml: 413; makefile: 221
file content (156 lines) | stat: -rw-r--r-- 4,589 bytes parent folder | download | duplicates (4)
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
FXC="fenix-fxc"
FXI="fenix-fxi"

all: plugins/ttf.so plugins/agua.so plugins/fgfx.so plugins/fire.so plugins/image.so \
	plugins/net.so plugins/mpeg.so plugins/mixer.so plugins/exec.so plugins/tcpsock.so \
	plugins/fsock.so

fullclean: distclean
	rm -f */aclocal.m4 */configure */Makefile.in
	rm -f */config.status */config.log */ltmain.sh

distclean: clean_tests
	@printf "\n == CLEAN: $@ ==\n\n"
	for i in */; do [ ! -f "$$i/Makefile" ] || $(MAKE) -C "$$i" distclean || exit 1 ; done
	rm -f plugins/*

clean: clean_tests
	@printf "\n == CLEAN: $@ ==\n\n"
	for i in */; do [ ! -f "$$i/Makefile" ] || $(MAKE) -C "$$i" clean || exit 1 ; done

clean_tests:
	@printf "\n == CLEAN: $@ ==\n\n"
	rm -f test_*.prg test_*.dcb

%/configure: %/configure.ac
	@printf "\n == CONFIGURE: $@ ==\n\n"
	cd `echo $@ | sed -e "s|/configure||"` && \
		autoreconf --force --verbose
	touch "$@"

%/config.status: %/configure
	@printf "\n == CONFIGURE: $@ ==\n\n"
	cd `echo $@ | sed -e "s|/config.status||"` && \
		./configure CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(CONFFLAGS) \
		--prefix=/usr \
		--mandir=\$${prefix}/share/man \
		--infodir=\$${prefix}/share/info \
		--with-vorbis-includes=/usr/include/vorbis/
	touch "$@"

plugins:
	mkdir -p plugins

plugins/agua.so: plugins agua-1.0/configure agua-1.0/config.status
	@printf "\n == BUILD: $@ ==\n\n"
	make -C agua-1.0
	cp agua-1.0/.libs/libagua.so "$@"

plugins/fgfx.so: plugins fgfx-1.0/configure fgfx-1.0/config.status
	@printf "\n == BUILD: $@ ==\n\n"
	make -C fgfx-1.0
	cp fgfx-1.0/.libs/libfgfx.so "$@"

plugins/fire.so: plugins fire-1.0/configure fire-1.0/config.status
	@printf "\n == BUILD: $@ ==\n\n"
	make -C fire-1.0
	cp fire-1.0/.libs/libfire.so "$@"

plugins/image.so: plugins image-1.0/configure image-1.0/config.status
	@printf "\n == BUILD: $@ ==\n\n"
	make -C image-1.0
	cp image-1.0/.libs/libimage.so "$@"

plugins/net.so: plugins net-1.0/configure net-1.0/config.status
	@printf "\n == BUILD: $@ ==\n\n"
	make -C net-1.0
	cp net-1.0/.libs/libnet.so "$@"

plugins/mpeg.so: plugins mpeg-1.0/configure mpeg-1.0/config.status
	@printf "\n == BUILD: $@ ==\n\n"
	make -C mpeg-1.0
	cp mpeg-1.0/.libs/libmpeg.so "$@"

plugins/mixer.so: plugins mixer-1.0/configure mixer-1.0/config.status
	@printf "\n == BUILD: $@ ==\n\n"
	make -C mixer-1.0
	cp mixer-1.0/.libs/libmixer.so "$@"

plugins/ttf.so: plugins ttf-1.0/configure ttf-1.0/config.status
	@printf "\n == BUILD: $@ ==\n\n"
	make -C ttf-1.0
	cp ttf-1.0/.libs/libttf.so "$@"

plugins/exec.so: plugins exec-0.4a/configure exec-0.4a/config.status
	@printf "\n == BUILD: $@ ==\n\n"
	make -C exec-0.4a
	cp exec-0.4a/.libs/libexec.so "$@"

plugins/tcpsock.so: plugins tcpsock-2.0/configure tcpsock-2.0/config.status
	@printf "\n == BUILD: $@ ==\n\n"
	make -C tcpsock-2.0
	cp tcpsock-2.0/.libs/libtcpsock.so "$@"

plugins/fsock.so: plugins fsock-1.0/configure fsock-1.0/config.status
	@printf "\n == BUILD: $@ ==\n\n"
	make -C fsock-1.0
	cp fsock-1.0/.libs/libfsock.so "$@"

check: check_symbols test_load.dcb

check_symbols:
	@printf "\n == CHECK: $@ ==\n\n"
	@for i in plugins/*.so; do \
		if objdump -T "$$i" | grep "RegisterFunctions" >/dev/null ; then \
			echo \"$$i\" has the dynamic symbol \"RegisterFunctions\" \[OK\] ; \
		else \
			echo \"$$i\" does not have the dynamic symbol \"RegisterFunctions\" \[ERROR\] ; \
			exit 1 ; \
		fi \
	done

	@for i in plugins/*.so; do \
		if objdump -T "$$i" | grep "PluginVersion" >/dev/null ; then \
			echo \"$$i\" has the dynamic symbol \"PluginVersion\" \[OK\] ; \
		else \
			echo \"$$i\" does not have the dynamic symbol \"PluginVersion\" \[ERROR\] ; \
			exit 1 ; \
		fi \
	done

.SUFFIXES: .prg .dcb

.prg.dcb:
	@printf "\n == CHECK: $@ ==\n\n"
	$(FXC) $< -o $@

test_load.prg:
	echo "PROGRAM TestLoad;" > $@
	for i in plugins/*.so; do \
		echo "IMPORT \"`echo \"$$i\" | sed -e \"s/\.so//\"`\"" >> $@ ; \
	done
	echo "GLOBAL" >> $@
	echo "BEGIN" >> $@
	echo "END" >> $@

update-config:
	@printf "\n == CONFIGURE: $@ ==\n\n"
	for i in */ ; do \
		if [ -e "$$i/configure.ac" ]; then \
			echo "Copying config.sub and config.guess files in \"$$i\"" ; \
			test -e /usr/share/misc/config.sub && \
				cp -f /usr/share/misc/config.sub "$$i/config.sub" ; \
			test -e /usr/share/misc/config.guess && \
				cp -f /usr/share/misc/config.guess "$$i/config.guess" ; \
		fi \
	done

configure: update-config
	@printf "\n == CONFIGURE: $@ ==\n\n"
	for i in */ ; do \
		if [ -e "$$i/configure.ac" ]; then \
			printf "\n - Creating autotools files in \"$$i\" -\n\n" ; \
			cd "$$i" && autoreconf --force --verbose || exit 1 ; \
			cd - ; \
		fi \
	done