Makefile.old 14 KB
Newer Older
Sam Hocevar's avatar
 
Sam Hocevar committed
1
###############################################################################
Sam Hocevar's avatar
 
Sam Hocevar committed
2
# vlc (VideoLAN Client) main Makefile - (c)1998 VideoLAN
Sam Hocevar's avatar
 
Sam Hocevar committed
3 4
###############################################################################

5 6 7
ifeq ($(shell [ ! -r Makefile.opts ] && echo 1),)
    include Makefile.opts
endif
8 9 10
ifeq ($(shell [ ! -r Makefile.config ] && echo 1),)
    include Makefile.config
endif
Sam Hocevar's avatar
 
Sam Hocevar committed
11 12 13 14 15 16 17 18

###############################################################################
# Objects and files
###############################################################################

#
# C Objects
# 
19 20 21 22
VLC := vlc
LIBVLC := libvlc
INTERFACE := interface intf_eject
PLAYLIST := playlist
23
INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock input_info
Sam Hocevar's avatar
 
Sam Hocevar committed
24
VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures
25
AUDIO_OUTPUT := audio_output filters input mixer output
26
STREAM_OUTPUT := stream_output
27
MISC := mtime modules threads cpu configuration netutils iso_lang messages objects extras
Sam Hocevar's avatar
 
Sam Hocevar committed
28

29 30 31
LIBVLC_OBJ :=	$(LIBVLC:%=src/%.o) \
		$(INTERFACE:%=src/interface/%.o) \
		$(PLAYLIST:%=src/playlist/%.o) \
Sam Hocevar's avatar
 
Sam Hocevar committed
32 33 34
		$(INPUT:%=src/input/%.o) \
		$(VIDEO_OUTPUT:%=src/video_output/%.o) \
		$(AUDIO_OUTPUT:%=src/audio_output/%.o) \
35
		$(STREAM_OUTPUT:%=src/stream_output/%.o) \
Sam Hocevar's avatar
 
Sam Hocevar committed
36
		$(MISC:%=src/misc/%.o)
Sam Hocevar's avatar
 
Sam Hocevar committed
37

38 39 40 41
VLC_OBJ := $(VLC:%=src/%.o)

C_OBJ := $(VLC_OBJ) $(LIBVLC_OBJ)

Sam Hocevar's avatar
 
Sam Hocevar committed
42 43 44
#
# Misc Objects
# 
Sam Hocevar's avatar
 
Sam Hocevar committed
45
ifeq ($(NEED_GETOPT),1)
46
LIBVLC_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o 
Sam Hocevar's avatar
 
Sam Hocevar committed
47 48
endif

Sam Hocevar's avatar
 
Sam Hocevar committed
49
ifeq ($(NEED_SYMBOLS),1)
50
LIBVLC_OBJ += src/misc/symbols.o
Sam Hocevar's avatar
 
Sam Hocevar committed
51 52
endif

Sam Hocevar's avatar
 
Sam Hocevar committed
53
ifeq ($(SYS),beos)
Sam Hocevar's avatar
 
Sam Hocevar committed
54
CPP_OBJ :=	src/misc/beos_specific.o
Sam Hocevar's avatar
 
Sam Hocevar committed
55 56 57
endif

ifneq (,$(findstring darwin,$(SYS)))
58
LIBVLC_OBJ +=	src/misc/darwin_specific.o
Sam Hocevar's avatar
 
Sam Hocevar committed
59 60
endif

Xavier Marchesini's avatar
 
Xavier Marchesini committed
61
ifneq (,$(findstring mingw32,$(SYS)))
62
LIBVLC_OBJ +=	src/misc/win32_specific.o
Xavier Marchesini's avatar
 
Xavier Marchesini committed
63 64
RESOURCE_OBJ :=	share/vlc_win32_rc.o
endif
Gildas Bazin's avatar
 
Gildas Bazin committed
65

66 67
LIBVLC_OBJ += $(CPP_OBJ) $(M_OBJ) $(BUILTIN_OBJ)
VLC_OBJ += $(RESOURCE_OBJ)
Sam Hocevar's avatar
 
Sam Hocevar committed
68

Sam Hocevar's avatar
 
Sam Hocevar committed
69 70 71
#
# Generated header
#
Sam Hocevar's avatar
 
Sam Hocevar committed
72
H_OBJ :=	src/misc/modules_builtin.h
Sam Hocevar's avatar
 
Sam Hocevar committed
73 74 75 76

#
# Other lists of files
#
Sam Hocevar's avatar
 
Sam Hocevar committed
77 78 79 80 81 82
C_DEP := $(C_OBJ:%.o=.dep/%.d)
CPP_DEP := $(CPP_OBJ:%.o=.dep/%.dpp)

#
# Translate plugin names
#
Sam Hocevar's avatar
 
Sam Hocevar committed
83
ifneq (,$(PLUGINS))
84
PLUGIN_OBJ := $(PLUGINS:%=modules/%.so)
Sam Hocevar's avatar
 
Sam Hocevar committed
85 86
endif
ifneq (,$(BUILTINS))
87
BUILTIN_OBJ := $(BUILTINS:%=modules/%.a)
Sam Hocevar's avatar
 
Sam Hocevar committed
88
endif
Sam Hocevar's avatar
 
Sam Hocevar committed
89

Sam Hocevar's avatar
 
Sam Hocevar committed
90 91 92
#
# Misc variables
#
Sam Hocevar's avatar
 
Sam Hocevar committed
93
VERSION := $(shell grep '^ *VERSION=' configure.in | head -1 | sed 's/"//g' | cut -f2 -d=)
Sam Hocevar's avatar
 
Sam Hocevar committed
94

Sam Hocevar's avatar
 
Sam Hocevar committed
95 96 97 98 99 100 101 102 103 104
# All symbols must be exported
export

###############################################################################
# Targets
###############################################################################

#
# Virtual targets
#
105
all: Makefile.opts vlc ${ALIASES} vlc.app plugins po mozilla/libvlcplugin.so
106 107

Makefile.opts:
Sam Hocevar's avatar
 
Sam Hocevar committed
108 109 110 111 112
	@echo "**** No configuration found, please run ./configure"
	@exit 1
#	./configure
#	$(MAKE) $(MAKECMDGOALS)
#	exit	
Sam Hocevar's avatar
 
Sam Hocevar committed
113 114 115 116

show:
	@echo CC: $(CC)
	@echo CFLAGS: $(CFLAGS)
Sam Hocevar's avatar
 
Sam Hocevar committed
117
	@echo LDFLAGS: $(LDFLAGS)
Sam Hocevar's avatar
 
Sam Hocevar committed
118 119 120 121
	@echo plugins_CFLAGS: $(plugins_CFLAGS)
	@echo plugins_LDFLAGS: $(plugins_LDFLAGS)
	@echo builtins_CFLAGS: $(builtins_CFLAGS)
	@echo builtins_LDFLAGS: $(builtins_LDFLAGS)
Sam Hocevar's avatar
 
Sam Hocevar committed
122 123 124 125 126 127 128 129
	@echo C_OBJ: $(C_OBJ)
	@echo CPP_OBJ: $(CPP_OBJ)
	@echo PLUGIN_OBJ: $(PLUGIN_OBJ)
	@echo BUILTIN_OBJ: $(BUILTIN_OBJ)

#
# Cleaning rules
#
130
clean: plugins-clean po-clean vlc-clean mozilla-clean
Sam Hocevar's avatar
 
Sam Hocevar committed
131
	rm -f src/*/*.o extras/*/*.o
Sam Hocevar's avatar
 
Sam Hocevar committed
132
	rm -f lib/*.so* lib/*.a
Sam Hocevar's avatar
 
Sam Hocevar committed
133
	rm -f plugins/*.so plugins/*.a plugins/*.lib plugins/*.tds
134
	rm -Rf extras/MacOSX/build
Sam Hocevar's avatar
 
Sam Hocevar committed
135

Sam Hocevar's avatar
 
Sam Hocevar committed
136 137 138
po-clean:
	-cd po && $(MAKE) clean

Sam Hocevar's avatar
 
Sam Hocevar committed
139
plugins-clean:
140
	for dir in $(shell echo $(PLUGIN_OBJ) $(BUILTIN_OBJ) | sed 's@\([^ ]*\)/[^ ]*@\1@g' ) ; do ( PARENT=`pwd` ; cd $${dir} && $(MAKE) -f $$PARENT/Makefile.modules clean PARENT=$$PARENT ) ; done
Sam Hocevar's avatar
 
Sam Hocevar committed
141 142

vlc-clean:
Sam Hocevar's avatar
 
Sam Hocevar committed
143
	rm -f $(C_OBJ) $(CPP_OBJ)
Sam Hocevar's avatar
 
Sam Hocevar committed
144
	rm -f vlc gnome-vlc gvlc kvlc qvlc vlc.exe
Sam Hocevar's avatar
 
Sam Hocevar committed
145
	rm -Rf vlc.app
Sam Hocevar's avatar
 
Sam Hocevar committed
146

147 148 149
mozilla-clean:
	-cd mozilla && $(MAKE) clean

Sam Hocevar's avatar
 
Sam Hocevar committed
150
distclean: clean
Sam Hocevar's avatar
Sam Hocevar committed
151
	-cd po && $(MAKE) maintainer-clean
Sam Hocevar's avatar
 
Sam Hocevar committed
152
	rm -f **/*.o **/*~ *.log
153
	rm -f Makefile.opts Makefile.config vlc-config
Sam Hocevar's avatar
 
Sam Hocevar committed
154
	rm -f include/defs.h include/modules_builtin.h
Sam Hocevar's avatar
 
Sam Hocevar committed
155
	rm -f src/misc/modules_builtin.h
Sam Hocevar's avatar
 
Sam Hocevar committed
156
	rm -f config*status config*cache config*log conftest*
Sam Hocevar's avatar
 
Sam Hocevar committed
157 158 159 160
	rm -f gmon.out core build-stamp
	rm -Rf .dep
	rm -f .gdb_history

Sam Hocevar's avatar
 
Sam Hocevar committed
161 162 163
#
# Install/uninstall rules
#
164
install: vlc-install plugins-install builtins-install libvlc-install po-install mozilla-install
Sam Hocevar's avatar
 
Sam Hocevar committed
165

166
uninstall: vlc-uninstall plugins-uninstall builtins-uninstall libvlc-uninstall po-uninstall mozilla-uninstall
Sam Hocevar's avatar
 
Sam Hocevar committed
167

Sam Hocevar's avatar
 
Sam Hocevar committed
168
vlc-install:
Sam Hocevar's avatar
 
Sam Hocevar committed
169 170
	mkdir -p $(DESTDIR)$(bindir)
	$(INSTALL) vlc $(DESTDIR)$(bindir)
Sam Hocevar's avatar
 
Sam Hocevar committed
171 172 173
ifneq (,$(ALIASES))
	for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
endif
174 175 176 177
	mkdir -p $(DESTDIR)$(datadir)/vlc
	$(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/vlc
	$(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/vlc
	$(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/vlc
Sam Hocevar's avatar
 
Sam Hocevar committed
178

Sam Hocevar's avatar
 
Sam Hocevar committed
179
vlc-uninstall:
Sam Hocevar's avatar
 
Sam Hocevar committed
180
	rm -f $(DESTDIR)$(bindir)/vlc
Sam Hocevar's avatar
 
Sam Hocevar committed
181 182 183
ifneq (,$(ALIASES))
	for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias ; fi ; done
endif
184 185 186
	rm -f $(DESTDIR)$(datadir)/vlc/*.psf
	rm -f $(DESTDIR)$(datadir)/vlc/*.png
	rm -f $(DESTDIR)$(datadir)/vlc/*.xpm
187
	-rmdir $(DESTDIR)$(datadir)/vlc
Sam Hocevar's avatar
 
Sam Hocevar committed
188

Sam Hocevar's avatar
 
Sam Hocevar committed
189
plugins-install:
190
	mkdir -p $(DESTDIR)$(libdir)/vlc
Sam Hocevar's avatar
 
Sam Hocevar committed
191
ifneq (,$(PLUGINS))
192 193 194 195 196
	for plugin in $(PLUGINS) ; \
		do dir=`echo $$plugin | sed -e 's@/[^ ]*@@g'` ; \
		mkdir -p $(DESTDIR)$(libdir)/vlc/$$dir ; \
		cp modules/$${plugin}.so $(DESTDIR)$(libdir)/vlc/$$dir ; \
	done
Sam Hocevar's avatar
 
Sam Hocevar committed
197 198
endif

Sam Hocevar's avatar
 
Sam Hocevar committed
199
plugins-uninstall:
200 201
	rm -f $(DESTDIR)$(libdir)/vlc/*/*.so
	-rmdir $(DESTDIR)$(libdir)/vlc/*
202
	-rmdir $(DESTDIR)$(libdir)/vlc
Sam Hocevar's avatar
 
Sam Hocevar committed
203

204 205 206
builtins-install:
	mkdir -p $(DESTDIR)$(libdir)/vlc
ifneq (,$(BUILTINS))
207
	$(INSTALL) -m 644 $(BUILTINS:%=modules/%.a) $(DESTDIR)$(libdir)/vlc
208 209 210 211
endif

builtins-uninstall:
	rm -f $(DESTDIR)$(libdir)/vlc/*.a
212
	-rmdir $(DESTDIR)$(libdir)/vlc
213

214 215 216 217 218 219 220 221 222 223 224 225 226
libvlc-install:
	mkdir -p $(DESTDIR)$(bindir)
	$(INSTALL) vlc-config $(DESTDIR)$(bindir)
	mkdir -p $(DESTDIR)$(includedir)/vlc
	$(INSTALL) -m 644 include/vlc/*.h $(DESTDIR)$(includedir)/vlc
	mkdir -p $(DESTDIR)$(libdir)
	$(INSTALL) -m 644 lib/libvlc.a $(DESTDIR)$(libdir)

libvlc-uninstall:
	rm -f $(DESTDIR)$(bindir)/vlc-config
	rm -Rf $(DESTDIR)$(includedir)/vlc
	rm -f $(DESTDIR)$(libdir)/libvlc.a

227 228 229 230 231 232 233 234 235 236
mozilla-install:
ifeq ($(MOZILLA),1)
	-cd mozilla && $(MAKE) install
endif

mozilla-uninstall:
ifeq ($(MOZILLA),1)
	-cd mozilla && $(MAKE) uninstall
endif

Sam Hocevar's avatar
 
Sam Hocevar committed
237 238 239 240 241 242
po-install:
	-cd po && $(MAKE) install

po-uninstall:
	-cd po && $(MAKE) uninstall

Sam Hocevar's avatar
 
Sam Hocevar committed
243 244 245
#
# Package generation rules
#
Sam Hocevar's avatar
 
Sam Hocevar committed
246
dist:
Sam Hocevar's avatar
 
Sam Hocevar committed
247 248 249 250 251 252 253 254 255
	# Check that tmp isn't in the way
	@if test -e tmp; then \
		echo "Error: please remove ./tmp, it is in the way"; false; \
	else \
		echo "OK."; mkdir tmp; \
	fi
	# Copy directory structure in tmp
	find -type d | grep -v '\(\.dep\|snapshot\|CVS\)' | while read i ; \
		do mkdir -p tmp/vlc/$$i ; \
Sam Hocevar's avatar
 
Sam Hocevar committed
256
	done
Sam Hocevar's avatar
 
Sam Hocevar committed
257
	rm -Rf tmp/vlc/tmp
Sam Hocevar's avatar
 
Sam Hocevar committed
258
	find debian -mindepth 1 -maxdepth 1 -type d | \
Sam Hocevar's avatar
 
Sam Hocevar committed
259
		while read i ; do rm -Rf tmp/vlc/$$i ; done
260
	# Copy .c .h .in .cpp .m and .glade files
261
	find include src modules -type f -name '*.[bcdhigmrst]*' | while read i ; \
Sam Hocevar's avatar
 
Sam Hocevar committed
262
		do cp $$i tmp/vlc/$$i ; done
Sam Hocevar's avatar
 
Sam Hocevar committed
263 264
	# Grmbl... special case...
	for i in API BUGS DESIGN TODO ; \
265
		do cp modules/mad/$$i tmp/vlc/modules/mad ; done
Sam Hocevar's avatar
 
Sam Hocevar committed
266
	# Copy plugin Makefiles
267
	find modules -type f -name Makefile | while read i ; \
Sam Hocevar's avatar
 
Sam Hocevar committed
268
		do cp $$i tmp/vlc/$$i ; done
Sam Hocevar's avatar
 
Sam Hocevar committed
269
	# Copy extra programs and documentation
Sam Hocevar's avatar
 
Sam Hocevar committed
270 271 272 273 274
	cp -a extras/* tmp/vlc/extras
	cp -a doc/* tmp/vlc/doc
	find tmp/vlc/extras tmp/vlc/doc \
		-type d -name CVS -o -name '.*' -o -name '*.[o]' | \
			while read i ; do rm -Rf $$i ; done
Sam Hocevar's avatar
 
Sam Hocevar committed
275
	# Copy gettext stuff
Sam Hocevar's avatar
 
Sam Hocevar committed
276
	cp po/ChangeLog po/vlc.pot po/*.po tmp/vlc/po
Sam Hocevar's avatar
 
Sam Hocevar committed
277
	for i in Makefile.in.in POTFILES.in ; do cp po/$$i tmp/vlc/po ; done
Sam Hocevar's avatar
 
Sam Hocevar committed
278
	# Copy misc files
Sam Hocevar's avatar
 
Sam Hocevar committed
279
	cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog* README* INSTALL* \
Sam Hocevar's avatar
 
Sam Hocevar committed
280
		ABOUT-NLS BUGS MODULES vlc.spec \
281
		Makefile Makefile.*.in Makefile.dep Makefile.modules \
Sam Hocevar's avatar
 
Sam Hocevar committed
282
		configure configure.in install-sh install-win32 macosx-dmg \
Sam Hocevar's avatar
 
Sam Hocevar committed
283
		config.sub config.guess aclocal.m4 mkinstalldirs \
Sam Hocevar's avatar
 
Sam Hocevar committed
284
			tmp/vlc/
Sam Hocevar's avatar
 
Sam Hocevar committed
285
	# Copy Debian control files
Sam Hocevar's avatar
 
Sam Hocevar committed
286
	for file in debian/*dirs debian/*docs debian/*menu debian/*desktop \
Sam Hocevar's avatar
 
Sam Hocevar committed
287
		debian/*copyright ; do cp $$file tmp/vlc/debian ; done
Sam Hocevar's avatar
 
Sam Hocevar committed
288
	for file in control changelog rules ; do \
Sam Hocevar's avatar
 
Sam Hocevar committed
289
		cp debian/$$file tmp/vlc/debian/ ; done
Sam Hocevar's avatar
 
Sam Hocevar committed
290
	# Copy ipkg control files
Sam Hocevar's avatar
 
Sam Hocevar committed
291
	for file in control rules patch ; do \
Sam Hocevar's avatar
 
Sam Hocevar committed
292
		cp ipkg/$$file tmp/vlc/ipkg/ ; done
Sam Hocevar's avatar
 
Sam Hocevar committed
293
	# Copy fonts and icons
Sam Hocevar's avatar
 
Sam Hocevar committed
294
	for file in share/*vlc* share/*psf; do \
Sam Hocevar's avatar
 
Sam Hocevar committed
295 296
		cp $$file tmp/vlc/share ; done
	# Build archives
Sam Hocevar's avatar
 
Sam Hocevar committed
297
	F=vlc-${VERSION}; \
298 299 300
	mv tmp/vlc tmp/$$F; (cd tmp ; \
		cd $$F && $(MAKE) distclean && cd .. ; \
		tar czf ../$$F.tar.gz $$F);
Sam Hocevar's avatar
 
Sam Hocevar committed
301 302
	# Clean up
	rm -Rf tmp
Sam Hocevar's avatar
 
Sam Hocevar committed
303

Sam Hocevar's avatar
 
Sam Hocevar committed
304 305 306 307 308 309 310 311 312 313 314
package-win32:
	# XXX: this rule is probably only useful to you if you have exactly
	# the same setup as me. Contact sam@zoy.org if you need to use it.
	#
	# Check that tmp isn't in the way
	@if test -e tmp; then \
		echo "Error: please remove ./tmp, it is in the way"; false; \
	else \
		echo "OK."; mkdir tmp; \
	fi
	# Create installation script
Sam Hocevar's avatar
 
Sam Hocevar committed
315
	cp install-win32 tmp/nsi
Sam Hocevar's avatar
 
Sam Hocevar committed
316
	# Copy relevant files
Sam Hocevar's avatar
 
Sam Hocevar committed
317 318
	cp vlc.exe tmp/ 
	$(STRIP) tmp/vlc.exe
Gildas Bazin's avatar
 
Gildas Bazin committed
319
	cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
Sam Hocevar's avatar
 
Sam Hocevar committed
320
	for file in AUTHORS COPYING ChangeLog README FAQ TODO ; \
Gildas Bazin's avatar
 
Gildas Bazin committed
321 322
			do cp $$file tmp/$${file}.txt ; \
			unix2dos tmp/$${file}.txt ; done
323
	mkdir tmp/plugins
324
ifneq (,$(PLUGINS))
325 326 327 328 329 330 331 332 333
	for i in $(PLUGINS) ; do \
		DIR=`echo $$i | cut -f1 -d/` ; \
		mkdir -p tmp/plugins/$$DIR ; \
		cp modules/$$i.so tmp/plugins/$$DIR ; \
		if test $$i != gui/win32/win32 ; then \
			$(STRIP) \
			tmp/plugins/$$DIR/`echo $$i | sed -e 's@.*/@@'`.so ; \
		fi ; \
	done
334
endif
Sam Hocevar's avatar
 
Sam Hocevar committed
335 336 337 338
	mkdir tmp/share
	for file in default8x16.psf default8x9.psf ; \
		do cp share/$$file tmp/share/ ; done
	# Create package 
Sam Hocevar's avatar
 
Sam Hocevar committed
339
	wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} /CD tmp/nsi
Sam Hocevar's avatar
 
Sam Hocevar committed
340 341 342
	# Clean up
	rm -Rf tmp

Sam Hocevar's avatar
 
Sam Hocevar committed
343 344 345 346 347 348 349 350 351 352 353 354
package-beos:
	# Check that tmp isn't in the way
	@if test -e tmp; then \
		echo "Error: please remove ./tmp, it is in the way"; false; \
	else \
		echo "OK."; mkdir tmp; \
	fi
	
	# Create dir
	mkdir -p tmp/vlc/share
	# Copy relevant files
	cp vlc tmp/vlc/
Sam Hocevar's avatar
 
Sam Hocevar committed
355
	strip tmp/vlc/vlc
356
	xres -o tmp/vlc/vlc ./share/vlc_beos.rsrc
Sam Hocevar's avatar
 
Sam Hocevar committed
357
	cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/vlc/
Sam Hocevar's avatar
 
Sam Hocevar committed
358 359
	for file in default8x16.psf default8x9.psf ; \
		do cp share/$$file tmp/vlc/share/ ; done
360 361 362
	mkdir tmp/vlc/modules
	cp $(PLUGINS:%=modules/%.so) tmp/vlc/modules/ 
	strip $(PLUGINS:%=tmp/vlc/modules/%.so)
Sam Hocevar's avatar
 
Sam Hocevar committed
363
	# Create package 
Sam Hocevar's avatar
 
Sam Hocevar committed
364 365
	mv tmp/vlc tmp/vlc-${VERSION}
	(cd tmp ; find vlc-${VERSION} | \
Sam Hocevar's avatar
 
Sam Hocevar committed
366
	zip -9 -@ vlc-${VERSION}-BeOS-x86.zip )
Sam Hocevar's avatar
 
Sam Hocevar committed
367
	mv tmp/vlc-${VERSION}-BeOS-x86.zip .
Sam Hocevar's avatar
 
Sam Hocevar committed
368 369 370
	# Clean up
	rm -Rf tmp

371 372 373 374 375 376 377 378 379 380
package-macosx:
	# Check that tmp isn't in the way
	@if test -e tmp; then \
		echo "Error: please remove ./tmp, it is in the way"; false; \
	else \
		echo "OK."; mkdir tmp; \
	fi

	# Copy relevant files 
	cp -R vlc.app tmp/
381
	cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf FAQ TODO tmp/
382 383

	# Create disk image 
Sam Hocevar's avatar
 
Sam Hocevar committed
384
	./macosx-dmg 0 "vlc-${VERSION}" tmp/* 
385 386 387 388

	# Clean up
	rm -Rf tmp

Sam Hocevar's avatar
 
Sam Hocevar committed
389 390 391 392 393
#
# Gtk/Gnome/* aliases and OS X application
#
gnome-vlc gvlc kvlc qvlc: vlc
	rm -f $@ && ln -s vlc $@
Sam Hocevar's avatar
 
Sam Hocevar committed
394

Sam Hocevar's avatar
 
Sam Hocevar committed
395
.PHONY: vlc.app
Sam Hocevar's avatar
 
Sam Hocevar committed
396
vlc.app: vlc plugins
Sam Hocevar's avatar
 
Sam Hocevar committed
397
ifneq (,$(findstring darwin,$(SYS)))
Sam Hocevar's avatar
 
Sam Hocevar committed
398
	rm -Rf vlc.app
Christophe Massiot's avatar
Christophe Massiot committed
399
	cd extras/MacOSX ; pbxbuild | grep -v '^ ' | grep -v '^\t' | grep -v "^$$"
400
	cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
401
	$(INSTALL) -d vlc.app/Contents/MacOS/share
402
	$(INSTALL) -d vlc.app/Contents/MacOS/modules
Sam Hocevar's avatar
 
Sam Hocevar committed
403
	$(INSTALL) vlc vlc.app/Contents/MacOS/
Sam Hocevar's avatar
 
Sam Hocevar committed
404
ifneq (,$(PLUGINS))
405
	$(INSTALL) $(PLUGINS:%=modules/%.so) vlc.app/Contents/MacOS/modules
Sam Hocevar's avatar
 
Sam Hocevar committed
406
endif
Sam Hocevar's avatar
 
Sam Hocevar committed
407 408 409 410 411 412 413 414
	$(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
endif

FORCE:

#
# Generic rules (see below)
#
415
src/misc/modules_builtin.h: Makefile.opts Makefile Makefile.config
416
	@echo "make[$(MAKELEVEL)]: Creating \`$@'"
Sam Hocevar's avatar
 
Sam Hocevar committed
417
	@rm -f $@ && cp $@.in $@
Sam Hocevar's avatar
 
Sam Hocevar committed
418
ifneq (,$(BUILTINS))
Sam Hocevar's avatar
 
Sam Hocevar committed
419
	@for i in $(BUILTINS) ; do \
420
		echo "int vlc_entry__modules_"`echo $$i | sed -e 'y@/@_@' -e 's@\..*@@'`"( module_t* );" >>$@; \
Sam Hocevar's avatar
 
Sam Hocevar committed
421
	done
Sam Hocevar's avatar
 
Sam Hocevar committed
422 423 424 425 426 427 428
	@echo "" >> $@ ;
endif
	@echo "#define ALLOCATE_ALL_BUILTINS() \\" >> $@ ;
	@echo "    do \\" >> $@ ;
	@echo "    { \\" >> $@ ;
ifneq (,$(BUILTINS))
	@for i in $(BUILTINS) ; do \
429
		echo "        ALLOCATE_BUILTIN(modules_"`echo $$i | sed -e 'y@/@_@' -e 's@\..*@@'`"); \\" >> $@ ; \
Sam Hocevar's avatar
 
Sam Hocevar committed
430
	done
Sam Hocevar's avatar
 
Sam Hocevar committed
431
endif
Sam Hocevar's avatar
 
Sam Hocevar committed
432 433
	@echo "    } while( 0 );" >> $@ ;
	@echo "" >> $@ ;
Sam Hocevar's avatar
 
Sam Hocevar committed
434

Sam Hocevar's avatar
 
Sam Hocevar committed
435 436 437 438 439 440
$(C_DEP): %.d: FORCE
	@$(MAKE) -s --no-print-directory -f Makefile.dep $@

$(CPP_DEP): %.dpp: FORCE
	@$(MAKE) -s --no-print-directory -f Makefile.dep $@

Sam Hocevar's avatar
 
Sam Hocevar committed
441
$(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
Sam Hocevar's avatar
 
Sam Hocevar committed
442
$(C_OBJ): %.o: $(H_OBJ)
Sam Hocevar's avatar
 
Sam Hocevar committed
443 444
$(C_OBJ): %.o: .dep/%.d
$(C_OBJ): %.o: %.c
445
	$(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
Sam Hocevar's avatar
 
Sam Hocevar committed
446

Sam Hocevar's avatar
 
Sam Hocevar committed
447
$(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
Sam Hocevar's avatar
 
Sam Hocevar committed
448
$(CPP_OBJ): %.o: $(H_OBJ)
Sam Hocevar's avatar
 
Sam Hocevar committed
449 450
$(CPP_OBJ): %.o: .dep/%.dpp
$(CPP_OBJ): %.o: %.cpp
451
	$(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
Sam Hocevar's avatar
 
Sam Hocevar committed
452

453 454 455 456 457 458
$(M_OBJ): %.o: Makefile.opts Makefile.dep Makefile
$(M_OBJ): %.o: $(H_OBJ)
$(M_OBJ): %.o: .dep/%.dm
$(M_OBJ): %.o: %.m
	$(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<

Gildas Bazin's avatar
 
Gildas Bazin committed
459 460 461 462 463 464
$(RESOURCE_OBJ): %.o: Makefile.dep Makefile
ifneq (,(findstring mingw32,$(SYS)))
$(RESOURCE_OBJ): %.o: %.rc
	$(WINDRES) -i $< -o $@
endif

Sam Hocevar's avatar
 
Sam Hocevar committed
465 466 467
#
# Main application target
#
468
vlc: Makefile.config Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.a $(BUILTIN_OBJ)
469
	$(CC) $(CFLAGS) -o $@ $(VLC_OBJ) lib/libvlc.a $(LDFLAGS) $(vlc_LDFLAGS) $(BUILTIN_OBJ) $(builtins_LDFLAGS)
Sam Hocevar's avatar
 
Sam Hocevar committed
470 471 472 473 474
ifeq ($(SYS),beos)
	xres -o $@ ./share/vlc_beos.rsrc
	mimeset -f $@
endif

475 476 477
#
# Main library target
#
478
lib/libvlc.a: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
479 480 481 482
	rm -f $@
	ar rc $@ $(LIBVLC_OBJ)
	$(RANLIB) $@

483 484 485 486
#
# DO NOT DISTRIBUTE SHARED VERSIONS OF LIBVLC UNTIL THE ABI IS STABLE
# OR BURN IN HELL -- Sam
#
487 488 489
#lib/libvlc.so: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
#	$(CC) -shared $(LIBVLC_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) -o $@

490
builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
Sam Hocevar's avatar
 
Sam Hocevar committed
491
plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
Sam Hocevar's avatar
 
Sam Hocevar committed
492

493
modules/%.a modules/%.so: $(H_OBJ) FORCE
494
	cd $(shell echo $@ | sed -e 's@\(.*\)/.*@\1@') && $(MAKE) -f $(shell echo $@ | sed -e 's@[^/]*/@../@g' -e 's@\(.*\)/.*@\1@')/Makefile.modules $(shell echo $@ | sed -e 's@.*/@@') PARENT=$(shell echo $@ | sed -e 's@[^/]*/@../@g' -e 's@\(.*\)/.*@\1@') MODULE_PATH=$(shell echo $@ | sed -e 'y@/@_@' -e 's@\..*@@')
Sam Hocevar's avatar
 
Sam Hocevar committed
495

496 497 498 499 500 501 502 503
#
# Mozilla plugin target
#
mozilla/libvlcplugin.so: FORCE
ifeq ($(MOZILLA),1)
	@cd mozilla && $(MAKE) builtins_LDFLAGS="$(builtins_LDFLAGS)"
endif

Sam Hocevar's avatar
 
Sam Hocevar committed
504 505 506 507 508
#
# gettext target
#
po: FORCE
	@cd po && $(MAKE)
Stéphane Borel's avatar
Stéphane Borel committed
509