1 CLEANFILES = ncmpc-tiny
3 AM_CPPFLAGS = \
4 $(GLIB_CFLAGS)\
5 $(GTHREAD_CFLAGS)\
6 $(LIBLIRCCLIENT_CFLAGS) \
7 -DLOCALE_DIR=\""$(datadir)/locale"\"\
8 -DSYSCONFDIR=\""$(sysconfdir)"\"
10 ncmpc_LDADD = \
11 $(GLIB_LIBS)\
12 $(GTHREAD_LIBS) \
13 $(LIBLIRCCLIENT_LIBS)
15 ncmpc_headers = \
16 libmpdclient.h\
17 resolver.h \
18 song.h \
19 mpdclient.h\
20 playlist.h \
21 filelist.h \
22 options.h\
23 conf.h\
24 command.h\
25 ncu.h \
26 screen.h\
27 screen_list.h \
28 screen_play.h \
29 screen_utils.h\
30 list_window.h\
31 colors.h\
32 hscroll.h \
33 charset.h \
34 match.h \
35 wreadln.h\
36 strfsong.h\
37 utils.h\
38 ncmpc.h\
39 defaults.h \
40 i18n.h \
41 screen_browser.h \
42 screen_text.h \
43 plugin.h \
44 lyrics.h \
45 str_pool.h \
46 lirc.h
48 bin_PROGRAMS = ncmpc
50 lyr_src=${lyr_src_fixed}
52 ncmpc_SOURCES = \
53 libmpdclient.c\
54 resolver.c \
55 song.c \
56 main.c\
57 mpdclient.c\
58 playlist.c \
59 filelist.c \
60 options.c\
61 command.c\
62 ncu.c \
63 screen.c\
64 screen_list.c \
65 screen_utils.c\
66 screen_play.c\
67 screen_browser.c\
68 screen_file.c\
69 list_window.c\
70 colors.c\
71 charset.c \
72 wreadln.c\
73 strfsong.c\
74 utils.c\
75 str_pool.c
77 if NCMPC_MINI
78 else
79 ncmpc_SOURCES += \
80 hscroll.c \
81 match.c \
82 conf.c
83 endif
85 if ENABLE_HELP_SCREEN
86 ncmpc_SOURCES += screen_help.c
87 endif
89 if ENABLE_ARTIST_SCREEN
90 ncmpc_SOURCES += screen_artist.c
91 endif
93 if ENABLE_SEARCH_SCREEN
94 ncmpc_SOURCES += screen_search.c
95 endif
97 if ENABLE_SONG_SCREEN
98 ncmpc_SOURCES += screen_song.c
99 endif
101 if ENABLE_KEYDEF_SCREEN
102 ncmpc_SOURCES += screen_keydef.c
103 endif
105 if ENABLE_PLUGIN_LIBRARY
106 ncmpc_SOURCES += plugin.c
107 endif
109 if ENABLE_SCREEN_TEXT
110 ncmpc_SOURCES += screen_text.c
111 endif
113 if ENABLE_LYRICS_SCREEN
114 ncmpc_SOURCES += screen_lyrics.c lyrics.c
115 endif
117 if ENABLE_OUTPUTS_SCREEN
118 ncmpc_SOURCES += screen_outputs.c
119 endif
121 if ENABLE_LIRC
122 ncmpc_SOURCES += lirc.c
123 endif
125 ncmpc_SOURCES+=${ncmpc_headers}
127 # build the smalles possible ncmpc binary
128 ncmpc-tiny: $(filter-out %.h,$(ncmpc_SOURCES))
129 $(COMPILE) --combine -fwhole-program $(ncmpc_LDFLAGS) $(ncmpc_LDADD) $(LIBS) $^ -o $@
130 strip --strip-all $@
132 #
133 # sparse
134 #
136 SPARSE = sparse
137 SPARSE_FLAGS = -Wdecl -Wdefault-bitfield-sign -Wdo-while -Wenum-mismatch \
138 -Wnon-pointer-null -Wptr-subtraction-blows -Wreturn-void \
139 -Wshadow -Wtypesign \
140 -D__transparent_union__=unused
142 sparse-check:
143 for i in $(ncmpc_SOURCES); \
144 do \
145 $(SPARSE) -I. -I.. -I/usr/lib/gcc/$(shell gcc -dumpmachine)/4.3/include -I/usr/lib/gcc/$(shell gcc -dumpmachine)/4.3/include-fixed $(AM_CPPFLAGS) $(SPARSE_FLAGS) $(srcdir)/$$i || exit; \
146 done