core: add support for the autoverbose feature
[fbsplash.git] / core / src / Makefile.am
blob3b5525d1e39f787d223e09affe8e0509f5b4f78c
1 ################################################################################
2 # automake file for generating the user splashutils' Makefile file.
4 # Copyright (c) 2004-2007, Michal Januszewski <spock@gentoo.org>
5 # Copyright (c) 2007, Paul Bender <pebender@gmail.com>
7 # This file is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # General Public License for more details.
16 ################################################################################
18 SUBDIRS = . test
20 include ../common.mk
22 ################################################################################
23 # General
24 ################################################################################
26 BUILT_SOURCES          =
28 noinst_HEADERS         =
29 nodist_include_HEADERS =
31 noinst_LTLIBRARIES     =
32 lib_LTLIBRARIES        =
34 noinst_PROGRAMS        =
35 eexecsbin_PROGRAMS     =
36 eexecbin_PROGRAMS      =
37 sbin_PROGRAMS          =
38 bin_PROGRAMS           =
40 EXTRA_DIST             =
41 MOSTLYCLEANFILES       =
43 if CONFIG_DEBUG
44 CFLAGS ?= -Wall -g
45 else
46 CFLAGS ?= -O2
47 endif
49 ################################################################################
50 # All
51 ################################################################################
53 INCLUDES = -I$(top_srcdir) -I$(top_builddir)
55 AM_MAKEFLAGS     =
56 AM_LIBTOOLFLAGS  =
58 BUILT_SOURCES   += fbsplash.h
60 dist-hook:              dist-hook-header
62 ################################################################################
63 # Header
64 ################################################################################
66 nodist_include_HEADERS  += fbsplash.h
68 EXTRA_DIST              += fbsplash.h.in
70 MOSTLYCLEANFILES        += fbsplash.h
72 dist-hook-header:
73         @# Removing this file from the distribution is easier than putting it
74         @# in a nodist_*_SOURCES rather than the normal _SOURCES list for all
75         @# the programs and libraries that depend on it.
76         @rm -f $(top_distdir)/fbsplash.h
78 fbsplash.h: fbsplash.h.in $(top_builddir)/config.h
79         @$(call infmsg,CREATE,$@)
80         $(Q)$(MKDIR_P) $(@D)
81         $(Q)rm -f $@
82         $(Q)cat $< | $(SED) \
83                 -e 's|@bindir[@]|$(eexecbindir)|g' \
84                 -e 's|@sbindir[@]|$(eexecsbindir)|g' \
85                 -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
86                 -e 's|@themedir[@]|$(themedir)|g' \
87                 -e 's|@libdir[@]|$(eexeclibdir)|g' \
88                 > $@
90 $(top_builddir)/config.h:
91         @echo "The file 'config.h' is missing. Please run 'configure'."
92         @exit 1
94 ################################################################################
95 # Library
96 ################################################################################
98 lib_LTLIBRARIES += libfbsplash.la
99 lib_LTLIBRARIES += libfbsplashrender.la
101 libfbsplash_la_SOURCES = libfbsplash.c common.h fbsplash.h
102 libfbsplash_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(libfbsplash_version)
103 libfbsplash_la_LIBADD  =
105 libfbsplashrender_la_SOURCES  = \
106         libfbsplashrender.c \
107         fbcon_decor.c \
108         common.c \
109         parse.c \
110         list.c \
111         image.c \
112         render.c \
113         effects.c \
114         fbcon_decor.h \
115         ../include/console_decor.h \
116         ../include/fbcondecor.h \
117         common.h \
118         render.h \
119         fbsplash.h
120 libfbsplashrender_la_CFLAGS   = $(AM_CFLAGS)
121 libfbsplashrender_la_LDFLAGS  = $(AM_LDFLAGS) -version-info $(libfbsplashrender_version)
122 libfbsplashrender_la_LIBADD   = -lfbsplash
124 libfbsplashrender_la_CFLAGS  += $(JPEG_CFLAGS)
125 libfbsplashrender_la_LIBADD  += $(JPEG_LIBS)
127 if CONFIG_MNG
128 libfbsplashrender_la_SOURCES += mng_callbacks.c mng_render.c mng_splash.h common.h render.h fbsplash.h
129 libfbsplashrender_la_CFLAGS  += $(MNG_CFLAGS)
130 libfbsplashrender_la_LIBADD  += $(MNG_LIBS)
131 endif
132 if CONFIG_PNG
133 libfbsplashrender_la_CFLAGS  += $(PNG_CFLAGS)
134 libfbsplashrender_la_LIBADD  += $(PNG_LIBS)
135 endif
136 if CONFIG_TTF
137 libfbsplashrender_la_SOURCES += ttf.c ttf.h fbsplash.h
138 libfbsplashrender_la_CFLAGS  += $(FREETYPE2_CFLAGS) $(M_CFLAGS)
139 libfbsplashrender_la_LIBADD  += $(FREETYPE2_LIBS)   $(M_LIBS)
140 endif
142 AM_MAKEFLAGS += "libfbsplashrender_la_CFLAGS=$(libfbsplashrender_la_CFLAGS)"
144 pkgconfigdir            = $(libdir)/pkgconfig
145 pkgconfig_DATA          = libfbsplash.pc libfbsplashrender.pc
146 EXTRA_DIST              += libfbsplash.pc.in libfbsplashrender.pc.in
147 MOSTLYCLEANFILES        += libfbsplash.pc libfbsplashrender.pc
149 %.pc: %.pc.in
150         @$(call infmsg,CREATE,$@)
151         $(Q)$(MKDIR_P) $(@D)
152         $(Q)rm -f $@
153         $(Q)cat $< | $(SED) \
154                 -e 's|@prefix[@]|$(prefix)|g' \
155                 -e 's|@exec_prefix[@]|$(exec_prefix)|g' \
156                 -e 's|@libdir[@]|$(libdir)|g' \
157                 -e 's|@includedir[@]|$(includedir)|g' \
158                 -e 's|@libs_private[@]|$(strip $($(basename $(@F))_la_LIBADD))|g' \
159                 > $@
161 ################################################################################
162 # User
163 ################################################################################
165 if CONFIG_FBCON_DECOR
166 sbin_PROGRAMS += fbcondecor_ctl
167 endif
168 sbin_PROGRAMS += fbsplashd
169 bin_PROGRAMS  += splash_util
170 eexecsbin_PROGRAMS += fbsplashctl
172 fbcondecor_ctl_SOURCES      = fbcon_decor_ctl.c fbcon_decor.h ../include/console_decor.h ../include/fbcondecor.h common.h fbsplash.h
173 fbcondecor_ctl_CPPFLAGS     = $(AM_CPPFLAGS) -DTARGET_UTIL $(libfbsplashrender_la_CFLAGS)
174 fbcondecor_ctl_LDFLAGS      = $(AM_LDFLAGS)
175 fbcondecor_ctl_LDADD        = libfbsplashrender.la libfbsplash.la
177 fbsplashd_SOURCES           = daemon_cmd.c daemon.c daemon.h common.h render.h fbsplash.h
178 fbsplashd_CPPFLAGS          = $(AM_CPPFLAGS) -DTARGET_UTIL
179 fbsplashd_CFLAGS            = $(AM_CFLAGS) $(PTHREAD_CFLAGS) $(RT_CFLAGS) $(libfbsplashrender_la_CFLAGS)
180 fbsplashd_LDFLAGS           = $(AM_LDFLAGS)
181 fbsplashd_LDADD             = libfbsplashrender.la libfbsplash.la $(PTHREAD_LIBS) $(RT_LIBS) $(GPM_LIBS)
183 splash_util_SOURCES         = util.c common.h fbsplash.h
184 splash_util_CPPFLAGS        = $(AM_CPPFLAGS) -DTARGET_UTIL $(libfbsplashrender_la_CFLAGS)
185 splash_util_LDFLAGS         = $(AM_LDFLAGS)
186 splash_util_LDADD           = libfbsplashrender.la libfbsplash.la
188 fbsplashctl_SOURCES         = $(fbsplashd_SOURCES) $(splash_util_SOURCES) fbsplashctl.c
189 fbsplashctl_CFLAGS          = $(AM_CFLAGS) $(PTHREAD_STATIC_CFLAGS) $(RT_CFLAGS) $(libfbsplashrender_la_CFLAGS) -DUNIFIED_BUILD
190 fbsplashctl_CPPFLAGS        = $(fbsplashd_CPPFLAGS) $(splash_util_CPPFLAGS)
191 fbsplashctl_LDFLAGS         = $(AM_LDFLAGS) -all-static
192 fbsplashctl_LDADD           = libfbsplashrender.la libfbsplash.la $(PTHREAD_STATIC_LIBS) $(RT_LIBS) $(GPM_LIBS)
194 if CONFIG_FBCON_DECOR
195 fbsplashctl_SOURCES += $(fbcondecor_ctl_SOURCES)
196 fbsplashctl_CPPFLAGS += $(fbcondecor_ctl_CPPFLAGS)
197 endif
199 install-exec-hook:
200         $(LN_S) $(DESTDIR)$(eexecsbindir)/fbsplashctl$(EXEEXT) $(DESTDIR)$(eexecsbindir)/fbsplashd.static$(EXEEXT)
201         $(LN_S) $(DESTDIR)$(eexecsbindir)/fbsplashctl$(EXEEXT) $(DESTDIR)$(eexecbindir)/splash_util.static$(EXEEXT)
202 if CONFIG_FBCON_DECOR
203         $(LN_S) $(DESTDIR)$(eexecsbindir)/fbsplashctl$(EXEEXT) $(DESTDIR)$(eexecsbindir)/fbcondecor_ctl.static$(EXEEXT)
204 endif
206 ################################################################################
207 # Kernel
208 ################################################################################
210 if CONFIG_HELPER
211 eexecsbin_PROGRAMS  += fbcondecor_helper
212 endif
214 fbcondecor_helper_SOURCES = \
215         kernel.c \
216         libfbsplash.c \
217         libfbsplashrender.c \
218         fbcon_decor.c \
219         common.c \
220         parse.c \
221         list.c \
222         render.c \
223         image.c \
224         effects.c \
225         fbcon_decor.h \
226         ../include/console_decor.h \
227         ../include/fbcondecor.h \
228         common.h \
229         render.h \
230         fbsplash.h
231 fbcondecor_helper_CPPFLAGS  = -DWITH_ERRLIST -DTARGET_KERNEL -DTT_CONFIG_OPTION_BYTECODE_INTERPRETER
232 fbcondecor_helper_CFLAGS    = -Os -w -ffunction-sections -fdata-sections -I.@am__isrc@
233 fbcondecor_helper_LDFLAGS   = 
234 fbcondecor_helper_LDADD     = 
235 fbcondecor_helper_CFLAGS   += -I$(abs_top_builddir)/libs/libjpeg -I$(LIBJPEG_SOURCE)
236 fbcondecor_helper_LDADD    += $(top_builddir)/libs/libjpeg.a
237 if CONFIG_PNG
238 fbcondecor_helper_CFLAGS   += -I$(LIBPNG_SOURCE)
239 fbcondecor_helper_LDADD    += $(top_builddir)/libs/libpng.a $(top_builddir)/libs/libz.a
240 endif
241 if CONFIG_TTF_KERNEL
242 fbcondecor_helper_SOURCES  += ttf.c ttf.h fbsplash.h
243 fbcondecor_helper_CFLAGS   += -I$(LIBFREETYPE2_SOURCE)/include -I$(LIBZ_SOURCE)
244 fbcondecor_helper_LDADD    += $(top_builddir)/libs/libfreetype.a
245 endif
246 if CONFIG_KLIBC_SHARED
247 fbcondecor_helper_LDFLAGS  += -shared
248 else
249 fbcondecor_helper_LDFLAGS  += -static
250 endif
252 # Override automake's generation of target rules for building fbcondecor_helper.
253 fbcondecor_helper: $(fbcondecor_helper_LDADD) $(fbcondecor_helper_OBJECTS)
254         @$(call infmsg,LD,$@)
255         $(Q)$(MKDIR_P) $(@D)
256         $(Q)$(KLCC) $(fbcondecor_helper_CFLAGS) $(fbcondecor_helper_LDFLAGS) $+ $(fbcondecor_helper_LDADD) -o $@
257         $(Q)$(STRIP) $@
259 # Override automake's generation of target rules for building fbcondecor_helper object files.
260 fbcondecor_helper-kernel.o:
261 fbcondecor_helper-libfbsplash.o:
262 fbcondecor_helper-libfbsplashrender.o:
263 fbcondecor_helper-fbcon_decor.o:
264 fbcondecor_helper-common.o:
265 fbcondecor_helper-parse.o:
266 fbcondecor_helper-list.o:
267 fbcondecor_helper-render.o:
268 fbcondecor_helper-image.o:
269 fbcondecor_helper-effects.o:
270 fbcondecor_helper-ttf.o:
271 fbcondecor_helper-%.o: %.c
272         @$(call infmsg,CC,$@)
273         $(Q)$(MKDIR_P) $(@D)
274         $(Q)$(KLCC) $(fbcondecor_helper_CPPFLAGS) $(fbcondecor_helper_CFLAGS) $(INCLUDES) -c $< -o $@