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