aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.in
blob: 19912aa8d9b961089a3377aeead643654c2f05a2 (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
bttvdir=@bttvdir@

srcdir=@srcdir@
VPATH=@srcdir@
prefix=@prefix@
exec_prefix=@exec_prefix@

bindir=$(exec_prefix)/bin
mandir=$(prefix)/man

kdebindir=$(KDEDIR)/bin
kdelnkdir=$(KDEDIR)/share/applnk/Multimedia
kradiodir=$(KDEDIR)/share/apps/kradio

CC=@CC@
CXX=@CXX@
MOC=$(QTDIR)/bin/moc
DEPEND=@DEPEND@
INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
INSTALL_DATA=@INSTALL_DATA@
INSTALL_DIR=mkdir -p

VERSION=$(shell basename `pwd`)
VRADIO=$(subst xawtv,kradio,$(VERSION))

CFLAGS=-g -Wall @CFLAGS@ -I. @X_CFLAGS@ -I$(bttvdir) -DVERSION='"$(VERSION)"'
CXXFLAGS = $(CFLAGS) -I$(QTDIR)/include -I$(KDEDIR)/include 
LDLIBS=@X_LIBS@ -l@XAWLIB@ -lXt @X_PRE_LIBS@ -lXext -lXmu \
	-lX11 @X_EXTRA_LIBS@ @LIBS@

PROGS=xawtv v4l-conf set-tv fbtv grab-one dump-mixers radio @KRADIO@

SRCS=	$(srcdir)/main.c\
	$(srcdir)/toolbox.c\
	$(srcdir)/mixer.c\
	$(srcdir)/channel.c\
	$(srcdir)/x11.c\
	$(srcdir)/grab-v4l.c
OBJS= main.o toolbox.o mixer.o channel.o x11.o grab-v4l.o

##########################################################################

.SUFFIXES: .cpp .moc

.cpp.o:
	$(CXX) -c $(CXXFLAGS) $<

.h.moc:
	$(MOC) $< -o $@

##########################################################################

all: $(PROGS)

xawtv: $(OBJS)
	$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDLIBS) @JPEG@

v4l-conf: v4l-conf.c
	$(CC) $(CFLAGS) -o $@ $< @X_LIBS@ -lXext -lX11 @X_EXTRA_LIBS@ @LIBS@

radio: radio.c
	$(CC) $(CFLAGS) -o $@ $<

dump-mixers: dump-mixers.c
	$(CC) $(CFLAGS) -o $@ $<

grab-one: grab-one.c
	$(CC) $(CFLAGS) -o $@ $<

set-tv: set-tv.o channel.o mixer.o grab-v4l.o
	$(CC) $(CFLAGS) -o $@ $^

fbtv: fbtv.o channel.o mixer.o grab-v4l.o
	$(CC) $(CFLAGS) -o $@ $^ @CURSES@ @JPEG@


kradio: kradio.moc kradio.o
	$(CXX) -o $@ kradio.o -L$(QTDIR)/lib -L$(KDEDIR)/lib @X_LIBS@ \
		-lkdeui -lkdecore -lqt @X_PRE_LIBS@ -lXext -lX11 @X_EXTRA_LIBS@


install: all
	$(INSTALL_PROGRAM) -s xawtv $(bindir)
	$(INSTALL_PROGRAM) -s set-tv $(bindir)
	$(INSTALL_PROGRAM) -s -m4711 -o root -g root v4l-conf $(bindir)
	$(INSTALL_DATA) xawtv.man $(mandir)/man1/xawtv.1
	$(INSTALL_DATA) Xawtv.ad @x_libraries@/X11/app-defaults/Xawtv
	make -C font install;
	if test "@KRADIO@" = "kradio"; then 			\
		$(INSTALL_PROGRAM) -s kradio $(kdebindir);	\
		$(INSTALL_DATA) *.kdelnk $(kdelnkdir);		\
		$(INSTALL_DIR) $(kradiodir)/toolbar;		\
		$(INSTALL_DATA) *.xpm $(kradiodir)/toolbar;	\
	fi
	if test -f fbtv; then					\
		$(INSTALL_PROGRAM) -s fbtv $(bindir);		\
	fi

clean:
	-rm -f *.o *.moc *~ core* *.bak TAGS

distclean: clean
	-rm -f config.cache config.h config.log config.status Makefile
	@echo "default:" > Makefile
	@echo "	./configure && make dep && make" >> Makefile
	-strip $(PROGS)

realclean: distclean
	-rm -f chan.h
	-rm -f $(PROGS)

depend dep:
	$(DEPEND) -- $(CFLAGS) -- $(SRCS) $(SRCS2)

#########################
# just for me...

tags:
	etags *.[ch]

check:
	ldd $(PROGS)

tar:
	find . -name snap0*.ppm  -print | xargs -i rm -f
	find . -name snap0*.jpeg -print | xargs -i rm -f
	make -C bttv/driver clean
	make -C font dist
	cd ..; tar cvzf $(VERSION).tar.gz $(VERSION)

diff:
	echo $(VERSION)
	(cd /tmp; tar xvzf `ls -t $(HOME)/2/src/Archives/xawtv-*.tar.gz | head -n 1`)
	(cd ..; diff -urN /tmp/xawtv-* $(VERSION) | gzip > $(VERSION).diff.gz)
	rm -rf /tmp/xawtv-*

kdetar:
	mkdir /tmp/$(VRADIO)
	cp kradio.cpp kradio.h *.xpm kradio.kdelnk font/led-fixed.bdf /tmp/$(VRADIO)
	cp Makefile.kradio /tmp/$(VRADIO)/Makefile
	touch /tmp/$(VRADIO)/config.h
	echo "some hints for compiling kradio are in the Makefile" > /tmp/$(VRADIO)/README
	(cd /tmp; tar cvzf - $(VRADIO)) > ../$(VRADIO).tar.gz
	rm -rf /tmp/$(VRADIO)

dist: distclean tar kdetar diff 

glibc: realclean
	CC=i486-pc-linux-gnuglibc2-gcc CXX=i486-pc-linux-gnuglibc2-g++	\
		./configure
	make

#-------------------------------------------------------------------------
# DO NOT DELETE THIS LINE -- make depend depends on it.

Privacy Policy