]> git.cworth.org Git - scherzo/blob - Makefile
Switch to using pango, not cairo_show_text for chord names
[scherzo] / Makefile
1 all: scherzo
2
3 scherzo_srcs :=         \
4         mnemon/mnemon.c \
5         scherzo.c       \
6         score.c
7
8 scherzo_modules = $(scherzo_srcs:.c=.o)
9
10 CFLAGS ?= -g
11 WARN_CFLAGS = -Wall -Wextra
12
13 SCHERZO_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags) -I./mnemon `pkg-config --cflags gtk+-2.0 alsa`
14
15 SCHERZO_LDFLAGS = $(LDFLAGS) `pkg-config --libs gtk+-2.0 alsa` -ltalloc
16
17 # The user has not set any verbosity, default to quiet mode and inform the
18 # user how to enable verbose compiles.
19 ifeq ($(V),)
20 quiet_DOC := "Use \"$(MAKE) V=1\" to see the verbose compile lines.\n"
21 quiet = @printf $(quiet_DOC)$(eval quiet_DOC:=)"$1 $@\n"; $($(shell echo $1 | sed -e s'/ .*//'))
22 endif
23 # The user has explicitly enabled quiet compilation.
24 ifeq ($(V),0)
25 quiet = @printf "$1 $@\n"; $($(shell echo $1 | sed -e s'/ .*//'))
26 endif
27 # Otherwise, print the full command line.
28 quiet ?= $($(shell echo $1 | sed -e s'/ .*//'))
29
30 .deps/%.d: %.c Makefile
31         @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
32         $(CC) -M $(CPPFLAGS) $(SCHERZO_CFLAGS) $< > $@.$$$$ 2>/dev/null ; \
33         sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
34         rm -f $@.$$$$
35
36 DEPS := $(scherzo_srcs:%.c=.deps/%.d)
37 -include $(DEPS)
38
39 %.o: %.c Makefile
40         $(call quiet,CC $(CFLAGS)) -c $(SCHERZO_CFLAGS) $< -o $@
41
42 scherzo: $(scherzo_modules)
43         $(call quiet,CC $(CFLAGS)) $^ $(SCHERZO_LDFLAGS) -o $@
44
45 CLEAN := $(CLEAN) scherzo $(scherzo_modules)
46
47 .PHONY : clean
48 clean:
49         rm -f $(CLEAN); rm -rf .deps
50