aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.in
blob: b6c7ad1011ea539aee4e6f1e5551aab5db12961b (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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
srcdir		:= @srcdir@
VPATH		:= $(srcdir)

# for package builds (buildroot install + no root privs needed)
DESTDIR=
SUID_ROOT=-m4755 -o root

# install paths
prefix		:= @prefix@
exec_prefix	:= @exec_prefix@
bindir		:= $(DESTDIR)@bindir@
mandir		:= $(DESTDIR)@mandir@
libdir		:= $(DESTDIR)@libdir@/xawtv
datadir		:= $(DESTDIR)@datadir@/xawtv
resdir		:= $(DESTDIR)@resdir@
config		:= @x11conf@/xawtvrc

# programs
CC		:= @CC@
CXX		:= @CXX@
INSTALL		:= @INSTALL@
INSTALL_PROGRAM := @INSTALL_PROGRAM@ -s
INSTALL_DATA	:= @INSTALL_DATA@
INSTALL_DIR	:= @INSTALL@ -d -m 755

# misc
VERSION		:= @VERSION@

# for CFLAGS
WARN_FLAGS	:= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
LFS_FLAGS	:= -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
X11_FLAGS	:= @X_CFLAGS@ -I/usr/X11R6/include/X11/fonts
LIB_FLAGS	:= -I. -I./vbistuff -I./x11 \
		   -I$(srcdir)/jwz -I$(srcdir)/common -I$(srcdir)/console \
		   -I$(srcdir)/x11 -I$(srcdir)/structs \
		   -I$(srcdir)/libng -Llibng

# various libraries
ATHENA_LIBS	:= @X_LIBS@ @LIBS@ @ATHENA@
MOTIF_LIBS	:= @X_LIBS@ @LIBS@ -lXm -lXmu -lXt @X_PRE_LIBS@ \
		   -lXp -lXpm -lXext -lX11 @X_EXTRA_LIBS@
THREAD_LIBS	:= @LIBPTHREAD@
CURSES_LIBS	:= @LIBCURSES@
LIRC_LIBS	:= @LIRC@
OSS_LIBS	:= @LIBOSS@
ALSA_LIBS	:= @LIBALSA@
AA_LIBS		:= @AALIBS@
QT_LIBS		:= @QTLIBS@
VBI_LIBS	:= @LIBZVBI@ -lm
GL_LIBS		:= @LIBGL@
DV_LIBS		:= @LIBDV@
FS_LIBS		:= -L@x_libraries@ @FSLIB@
DLFLAGS		:= @DLFLAGS@

# stuff configure has found
FOUND_AALIB	:= @FOUND_AALIB@
FOUND_ALSA	:= @FOUND_ALSA@
FOUND_DV	:= @FOUND_DV@
FOUND_GL	:= @FOUND_GL@
FOUND_LQT	:= @FOUND_LQT@
FOUND_MOTIF	:= @FOUND_MOTIF@
FOUND_OS	:= @FOUND_OS@
FOUND_X11	:= @FOUND_X11@
FOUND_ZVBI	:= @FOUND_ZVBI@
USE_MMX		:= @USE_MMX@

# build final cflags
CFLAGS	:= @CFLAGS@
CFLAGS	+= $(WARN_FLAGS)
CFLAGS	+= $(LFS_FLAGS)
CFLAGS	+= $(X11_FLAGS)
CFLAGS	+= $(LIB_FLAGS)
CFLAGS	+= -DCONFIGFILE='"$(config)"'
CFLAGS	+= -DLIBDIR='"$(libdir)"'
CFLAGS	+= -DDATADIR='"$(datadir)"'
CFLAGS	+= -DVERSION='"$(VERSION)"'
CXXFLAGS = $(CFLAGS)

# shared objects need -fPIC
%.so : CFLAGS += -fPIC

# libraries
LDLIBS  := @LDLIBS@


#########################################################
# targets

build: all

Makefile: $(srcdir)/Makefile.in $(srcdir)/configure
	$(srcdir)/configure

$(srcdir)/configure: $(srcdir)/configure.ac
	(cd $(srcdir); autoconf && autoheader && rm -rf autom4te.cache)

install:: all
	$(INSTALL_DIR) $(bindir)

clean::
	find . -name \*~ -print | xargs rm -f
	find . -name \*.o -print | xargs rm -f
	find . -name \*.a -print | xargs rm -f
	find . -name \*.dep -print | xargs rm -f
	rm -f $(depfiles)

distclean:: clean
	-rm -f Makefile Make.config
	-rm -f config.cache config.h config.log config.status
	cp Makefile.clean Makefile

realclean:: distclean
	find . -name snap0*.ppm  -print | xargs -i rm -f
	find . -name snap0*.jpeg -print | xargs -i rm -f
	find . -name .nfs* -print | xargs -i rm -f
	find . -name core.* -print | xargs -i rm -f


#########################################################
# some rules ...

include $(srcdir)/mk/compile.mk

%.h: %.in
	perl $(srcdir)/scripts/html.pl < $< > $@

%.h: %.ad
	perl $(srcdir)/scripts/fallback.pl < $< > $@


#########################################################
# include stuff

# must come first
include $(srcdir)/common/Subdir.mk

# subdirs
include $(srcdir)/console/Subdir.mk
include $(srcdir)/debug/Subdir.mk
include $(srcdir)/frequencies/Subdir.mk
include $(srcdir)/libng/Subdir.mk
include $(srcdir)/libng/plugins/Subdir.mk
include $(srcdir)/libng/contrib-plugins/Subdir.mk
include $(srcdir)/man/Subdir.mk
include $(srcdir)/scripts/Subdir.mk
include $(srcdir)/vbistuff/Subdir.mk
include $(srcdir)/x11/Subdir.mk

# dependencies
-include $(depfiles)


#########################################################
# just for me, some maintaining jobs.  Don't use them

checkit: distclean
	dpkg-buildpackage -tc -us -uc -rfakeroot
	lintian ../xawtv_*.changes

release: distclean
	dpkg-buildpackage -tc -rfakeroot

port:
	dpkg-buildpackage -b -tc -rfakeroot

tarball: distclean
	(cd ..; tar cvzf xawtv_$(VERSION).tar.gz \
		xawtv-$(VERSION))

rpm: tarball
	rpm -ta ../xawtv_$(VERSION).tar.gz

snapshot: distclean
	(cd ..; tar cvzf xawtv-snap-`date +%Y-%m-%d`.tar.gz \
		xawtv-$(VERSION))

Privacy Policy