1# $Id: Makefile.am 1344 2009-06-22 01:11:09Z toni $
2
3# Moved to configure.ac's AM_INIT_AUTOMAKE
4#AUTOMAKE_OPTIONS = foreign
5
6SUBDIRS = src
7
8EXTRA_DIST = BUILD.Windows.txt INSTALL.Windows.txt doxygen.cfg \
9			 debian/changelog debian/control debian/compat debian/copyright \
10			 debian/docs debian/README.Debian debian/rules \
11			 freebsd/pkg-descr freebsd/Makefile.in freebsd/Makefile \
12			 msvc/mp3plot.sln msvc/mp3plot.vcproj \
13			 mp3plot.spec.in mp3plot.spec \
14			 AUTHORS
15
16static:
17	$(MAKE) CXXFLAGS="$(CXXFLAGS) -static"
18
19docs:
20	doxygen doxygen.cfg
21
22#mp3plot.1:
23#	$(MAKE) -C src $@
24#
25#mp3plot-manpage.pdf:
26#	$(MAKE) -C src $@
27
28staticpkg: static
29STATICNAME:=@PACKAGE@-@VERSION@-static-$(build_cpu)-$(build_os)
30	@MKDIR_P@ $(STATICNAME)
31	cd $(STATICNAME) && \
32		$(LN_S) ../ChangeLog ../README ../COPYING ../src/@PACKAGE@ . && \
33		strip @PACKAGE@
34# Not very portable...
35	fakeroot tar chf - "$(STATICNAME)" --label='@PACKAGE@ @VERSION@ <@UPSTREAM_URL@>' | \
36		   GZIP=$(GZIP_ENV) gzip -c >$(STATICNAME).tar.gz
37	$(RM) -r $(STATICNAME)
38
39
40# Aliases
41doxygen: docs
42dox: docs
43
44# RPM generation
45# To check a generated rpm:
46# $ rpm -p file.rpm -qi	# Information
47# $ rpm -p file.rpm -ql # List of files
48rpm-pkg:
49	rpmbuild -bb mp3plot.spec
50
51# The distinfo file contains the hashes of the distribution tarball, on FreeBSD
52# systems it is created by putting the tarball in /usr/ports/distfiles and
53# running make makesum on the port dir. It can obviously not be part of the tarball,
54# this rule creates a fake of it
55# This rule is meant to be run from my devel box, I won't try to make it portable
56freebsd/distinfo: @PACKAGE@-@VERSION@.tar.gz
57	@echo "MD5 (@PACKAGE@-@VERSION@.tar.gz) = $(shell md5sum @PACKAGE@-@VERSION@.tar.gz | sed 's/ .*//')" >$@
58	@echo "SHA256 (@PACKAGE@-@VERSION@.tar.gz) = $(shell sha256sum @PACKAGE@-@VERSION@.tar.gz | sed 's/ .*//')" >>$@
59	@echo "SIZE (@PACKAGE@-@VERSION@.tar.gz) = $(shell du --bytes @PACKAGE@-@VERSION@.tar.gz | sed 's/[^0-9].*//')" >>$@
60
61# This creates a port-@VERSION@.tar.gz file that can be decompressed directly
62# over the FreeBSD port directory for mp3plot to update it
63port: freebsd/distinfo
64	@tar --numeric-owner -C freebsd -zcvf port-@VERSION@.tar.gz Makefile pkg-descr distinfo
65
66.PHONY: rpm-pkg port
67
68# vim:set ts=4 noet ai: #
69
70