1
|
1 # LINUX Makefile made by A'rpi / Astral
|
|
2 # Some cleanup by LGB: * 'make -C dir' instead of 'cd dir;make;cd..'
|
|
3 # * for loops instead of linear sequence of make directories
|
|
4 # * some minor problems with make clean and distclean were corrected
|
|
5
|
|
6 include config.mak
|
|
7
|
78
|
8 #install...
|
|
9 OWNER = root
|
|
10 GROUP = root
|
|
11 PERM = 755
|
|
12
|
1
|
13 PRG = mplayer
|
|
14 PRG_AVIP = aviparse
|
|
15 PRG_TV = tvision
|
|
16 prefix = /usr/local
|
|
17 BINDIR = ${prefix}/bin
|
|
18 # BINDIR = /usr/local/bin
|
|
19 SRCS = linux/getch2.c linux/timer-lx.c linux/shmem.c xa/xa_gsm.c lirc_mp.c
|
|
20 OBJS = linux/getch2.o linux/timer-lx.o linux/shmem.o xa/xa_gsm.o lirc_mp.o
|
|
21 CFLAGS = $(OPTFLAGS) -Iloader -Ilibvo # -Wall
|
|
22 A_LIBS = -Lmp3lib -lMP3 -Llibac3 -lac3
|
|
23 VO_LIBS = -Llibvo -lvo $(X_LIBS)
|
|
24
|
|
25 .SUFFIXES: .c .o
|
|
26
|
|
27 # .PHONY: all clean
|
|
28
|
|
29 all: $(PRG)
|
|
30 # $(PRG_AVIP)
|
|
31
|
|
32 .c.o:
|
|
33 $(CC) -c $(CFLAGS) -o $@ $<
|
|
34
|
|
35 COMMONLIBS = libvo/libvo.a libac3/libac3.a mp3lib/libMP3.a
|
|
36
|
|
37 loader/libloader.a:
|
|
38 $(MAKE) -C loader
|
|
39
|
|
40 libmpeg2/libmpeg2.a:
|
|
41 $(MAKE) -C libmpeg2
|
|
42
|
|
43 libvo/libvo.a:
|
|
44 $(MAKE) -C libvo
|
|
45
|
|
46 libac3/libac3.a:
|
|
47 $(MAKE) -C libac3
|
|
48
|
|
49 mp3lib/libMP3.a:
|
|
50 $(MAKE) -C mp3lib
|
|
51
|
|
52 opendivx/libdecore.a:
|
|
53 $(MAKE) -C opendivx
|
|
54
|
|
55 encore/libencore.a:
|
|
56 $(MAKE) -C encore
|
|
57
|
28
|
58 $(PRG): .depend mplayer.o $(OBJS) loader/libloader.a libmpeg2/libmpeg2.a opendivx/libdecore.a $(COMMONLIBS) encore/libencore.a
|
1
|
59 $(CC) $(CFLAGS) -o $(PRG) mplayer.o $(OBJS) $(XMM_LIBS) $(LIRC_LIBS) $(A_LIBS) -lm $(TERMCAP_LIB) -Lloader -lloader -ldl -Llibmpeg2 -lmpeg2 -Lopendivx -ldecore $(VO_LIBS) -Lencore -lencore -lpthread
|
|
60
|
28
|
61 $(PRG_AVIP): .depend aviparse.o $(OBJS) loader/libloader.a $(COMMONLIBS)
|
1
|
62 $(CC) $(CFLAGS) -o $(PRG_AVIP) aviparse.o $(OBJS) $(A_LIBS) -lm $(TERMCAP_LIB) -Lloader -lloader -ldl $(VO_LIBS) -lpthread
|
|
63
|
28
|
64 $(PRG_TV): .depend tvision.o $(OBJS) $(COMMONLIBS)
|
1
|
65 $(CC) $(CFLAGS) -o $(PRG_TV) tvision.o $(OBJS) -lm $(TERMCAP_LIB) $(VO_LIBS)
|
|
66
|
|
67 install: $(PRG)
|
78
|
68 install -g $(GROUP) -o $(OWNER) -m $(PERM) -s $(PRG) $(BINDIR)
|
22
|
69 install -D -m 644 DOCS/mplayer.1 $(prefix)/man/man1/mplayer.1
|
1
|
70
|
|
71 clean:
|
|
72 rm -f *.o *~ $(OBJS)
|
|
73
|
|
74 distclean:
|
|
75 @for a in mp3lib libac3 libmpeg2 opendivx encore libvo loader drivers drivers/syncfb ; do $(MAKE) -C $$a distclean ; done
|
28
|
76 rm -f *~ $(PRG) $(PRG_AVIP) $(PRG_TV) $(OBJS) *.o *.a .depend
|
1
|
77
|
|
78 dep: depend
|
|
79
|
28
|
80 depend: .depend
|
1
|
81 @for a in mp3lib libac3 libmpeg2 libvo opendivx encore ; do $(MAKE) -C $$a dep ; done
|
|
82
|
28
|
83 .depend: Makefile config.mak config.h
|
|
84 makedepend -f- -- $(CFLAGS) -- mplayer.c aviparse.c tvision.c $(SRCS) 1>.depend 2>/dev/null
|
22
|
85
|
28
|
86 #
|
|
87 # include dependency files if they exist
|
|
88 #
|
|
89 ifneq ($(wildcard .depend),)
|
|
90 include .depend
|
|
91 endif
|