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
|
|
8 PRG = mplayer
|
|
9 PRG_AVIP = aviparse
|
|
10 PRG_TV = tvision
|
|
11 prefix = /usr/local
|
|
12 BINDIR = ${prefix}/bin
|
|
13 # BINDIR = /usr/local/bin
|
|
14 SRCS = linux/getch2.c linux/timer-lx.c linux/shmem.c xa/xa_gsm.c lirc_mp.c
|
|
15 OBJS = linux/getch2.o linux/timer-lx.o linux/shmem.o xa/xa_gsm.o lirc_mp.o
|
|
16 CFLAGS = $(OPTFLAGS) -Iloader -Ilibvo # -Wall
|
|
17 A_LIBS = -Lmp3lib -lMP3 -Llibac3 -lac3
|
|
18 VO_LIBS = -Llibvo -lvo $(X_LIBS)
|
|
19
|
|
20 .SUFFIXES: .c .o
|
|
21
|
|
22 # .PHONY: all clean
|
|
23
|
|
24 all: $(PRG)
|
|
25 # $(PRG_AVIP)
|
|
26
|
|
27 .c.o:
|
|
28 $(CC) -c $(CFLAGS) -o $@ $<
|
|
29
|
|
30 COMMONLIBS = libvo/libvo.a libac3/libac3.a mp3lib/libMP3.a
|
|
31
|
|
32 loader/libloader.a:
|
|
33 $(MAKE) -C loader
|
|
34
|
|
35 libmpeg2/libmpeg2.a:
|
|
36 $(MAKE) -C libmpeg2
|
|
37
|
|
38 libvo/libvo.a:
|
|
39 $(MAKE) -C libvo
|
|
40
|
|
41 libac3/libac3.a:
|
|
42 $(MAKE) -C libac3
|
|
43
|
|
44 mp3lib/libMP3.a:
|
|
45 $(MAKE) -C mp3lib
|
|
46
|
|
47 opendivx/libdecore.a:
|
|
48 $(MAKE) -C opendivx
|
|
49
|
|
50 encore/libencore.a:
|
|
51 $(MAKE) -C encore
|
|
52
|
28
|
53 $(PRG): .depend mplayer.o $(OBJS) loader/libloader.a libmpeg2/libmpeg2.a opendivx/libdecore.a $(COMMONLIBS) encore/libencore.a
|
1
|
54 $(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
|
|
55
|
28
|
56 $(PRG_AVIP): .depend aviparse.o $(OBJS) loader/libloader.a $(COMMONLIBS)
|
1
|
57 $(CC) $(CFLAGS) -o $(PRG_AVIP) aviparse.o $(OBJS) $(A_LIBS) -lm $(TERMCAP_LIB) -Lloader -lloader -ldl $(VO_LIBS) -lpthread
|
|
58
|
28
|
59 $(PRG_TV): .depend tvision.o $(OBJS) $(COMMONLIBS)
|
1
|
60 $(CC) $(CFLAGS) -o $(PRG_TV) tvision.o $(OBJS) -lm $(TERMCAP_LIB) $(VO_LIBS)
|
|
61
|
|
62 install: $(PRG)
|
|
63 strip $(PRG)
|
|
64 cp $(PRG) $(BINDIR)
|
22
|
65 install -D -m 644 DOCS/mplayer.1 $(prefix)/man/man1/mplayer.1
|
1
|
66
|
|
67 clean:
|
|
68 rm -f *.o *~ $(OBJS)
|
|
69
|
|
70 distclean:
|
|
71 @for a in mp3lib libac3 libmpeg2 opendivx encore libvo loader drivers drivers/syncfb ; do $(MAKE) -C $$a distclean ; done
|
28
|
72 rm -f *~ $(PRG) $(PRG_AVIP) $(PRG_TV) $(OBJS) *.o *.a .depend
|
1
|
73
|
|
74 dep: depend
|
|
75
|
28
|
76 depend: .depend
|
1
|
77 @for a in mp3lib libac3 libmpeg2 libvo opendivx encore ; do $(MAKE) -C $$a dep ; done
|
|
78
|
28
|
79 .depend: Makefile config.mak config.h
|
|
80 makedepend -f- -- $(CFLAGS) -- mplayer.c aviparse.c tvision.c $(SRCS) 1>.depend 2>/dev/null
|
22
|
81
|
28
|
82 #
|
|
83 # include dependency files if they exist
|
|
84 #
|
|
85 ifneq ($(wildcard .depend),)
|
|
86 include .depend
|
|
87 endif
|