put example files to dedicated dir
[monster.git] / GNUmakefile
blob610104ce51ff7f03db0bc59d47863576a05fd79b
1 # This file is part of moster
3 # Copyright (C) 2006,2007 Nedko Arnaudov <nedko@arnaudov.name>
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; version 2 of the License
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 default: monster
20 GENDEP_SED_EXPR = "s/^\\(.*\\)\\.o *: /$(subst /,\/,$(@:.d=.o)) $(subst /,\/,$@) : /g"
21 GENDEP_C = set -e; $(GCC_PREFIX)gcc -MM $(CFLAGS) $< | sed $(GENDEP_SED_EXPR) > $@; [ -s $@ ] || rm -f $@
23 CFLAGS = -g -Wall -Werror -Wcast-align -Wno-strict-aliasing -Werror-implicit-function-declaration -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
24 LIBS = -lpthread -lasound -lcurses
26 CFLAGS += $(shell pkg-config --cflags libxml-2.0)
27 LIBS += $(shell pkg-config --libs libxml-2.0)
29 SOURCES = player_video1394.c player_alsa_pcm.c player_alsa_midi.c media_source_dv.c media_source_wav.c media_source_midi.c monster.c conf.c xml.c song_player.c playback.c log.c path.c
31 OBJECTS = $(SOURCES:%.c=%.o)
32 DEP_FILES = $(OBJECTS:.o=.d)
34 monster: $(OBJECTS)
35 @echo "Linking $@ ..."
36 @gcc $(OBJECTS) -o monster $(LIBS)
38 clean:
39 -rm monster $(OBJECTS)
41 fullclean: clean
42 -rm $(DEP_FILES)
44 %.o:%.c
45 @echo "Compiling $< to $@ ..."
46 @gcc -c $(CFLAGS) $< -o $@
48 %.d:%.c
49 @echo "Creating dependency file $@ for $<"
50 @$(GENDEP_C)
52 # All object and dependency files depend on this file
53 $(OBJECTS) $(DEP_FILES): GNUmakefile
55 -include $(DEP_FILES)