summaryrefslogtreecommitdiff
path: root/Makefile.am
blob: 27fdb40b1e311b2391a26baa5fbbd744588e7350 (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
# Process this file with automake to generate a GNU Makefile

########################################################################
# put file lists and special compile rules here

bin_SCRIPTS = gphoto2-config

EXTRA_DIST = HACKING MAINTAINERS makefile.os2 os2mak.inc TESTERS CHANGES

# Note: @subdirs@ lists all the directories from AC_CONFIG_SUBDIRS()
SUBDIRS = . @subdirs@ libgphoto2 camlibs tests po bindings packaging doc

doc_DATA = AUTHORS COPYING README CHANGES NEWS

# Create gphoto2/ directory and copy all header files into it.
#
# Reasons to do that:
#  - Both libgphoto2 and libgphoto2_port install their *.h files
#    into $(includedir)/gphoto2
#  - Example programs can use #include <gphoto2/gphoto2-foobar.h>
#    like any libgphoto2 frontend is supposed to do.
#    (Promotes clean API use)
#  - Helps build libgphoto2 frontends against libgphoto2 without
#    installing libgphoto2 first.
#
# This functionality requires the "." to be the first item in SUBDIRS
# and makes it possible to consistently use #include <gphoto2/stuff.h>.

all-local:
	@echo "Creating/Updating gphoto2/ directory with gphoto2*.h files"
	@rm -f gphoto2/gphoto2*.h
	@mkdir -p gphoto2
	@cp \
		libgphoto2/gphoto2*.h \
		libgphoto2_port/libgphoto2_port/gphoto2*.h \
		$(srcdir)/libgphoto2/gphoto2*.h \
		$(srcdir)/libgphoto2_port/libgphoto2_port/gphoto2*.h \
		gphoto2/ > /dev/null 2>&1 \
		|| true

clean-local:
	rm -f gphoto2/gphoto2*.h
	rmdir gphoto2 || true

# we use just ONE .PHONY target in order not to confuse automake

.PHONY: rpm cvs-tags source-code-check

########################################################################
# source code check maintenance task
#
#   This finds code patterns we don't want to have.
#
#   Use it to get rid of existing patterns and make sure they aren't
#   reintroduced later.
#
#   The output is meant to be read and interpreted by human programmers.

source-code-check:
	@echo "######## Finding // comments"
	find . -type f -name '*.[ch]' -exec egrep -H '(^//|[^:]//)' {} \;
	@echo "######## Finding remainders of Arnaud's comment replacement"
	find . -type f -name '*.[ch]' -exec egrep -H 'http:/\*' {} \;
	@echo "######## Finding explicit libintl.h references"
	find . -type f -name '*.[ch]' -exec egrep -H '^#.*include.*libintl\.h' {} \;

########################################################################
# The following default options for aclocal and automake
# are required in the top level Makefile.am for the automatic 
# re-building of the build system files.

ACLOCAL_AMFLAGS = -I libgphoto2_port/m4


########################################################################
# The following rules are only interesting if you want to create
# distribution packages (as source tarballs or system specific packages)

if ENABLE_RPM

# create RPM packages
rpm: Makefile
	$(MAKE) dist
	$(MAKE) -C packaging/rpm rpm
	@echo "The RPM packages should now be found in packaging/rpm/RPMS"

else
rpm:
	@echo "Dummy $@ target"
endif

# add CVS tags - used only by the project maintainer to tag the files of a
# released version
cvs-tags: Makefile
	@echo cvs tag "@PACKAGE@-$$(echo '@VERSION@' | sed -e 's/\./_/g' -e 's/rc/-rc/g')"