X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=Makefile;h=c1ee124f72f5060286c099bbb4674027b7d1efa3;hb=aae6b7f55870ab7f9cd41f95e22231e66a673aea;hp=a5e8015e0bb73a569359d0b04a76217e0739d97d;hpb=0261a9e510c766d7c8c69a8d66783bf050683c9f;p=scherzo diff --git a/Makefile b/Makefile index a5e8015..c1ee124 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,18 @@ all: scherzo -scherzo_srcs = \ +scherzo_srcs := \ + mnemon/mnemon.c \ scherzo.c \ score.c scherzo_modules = $(scherzo_srcs:.c=.o) -WARN_CFLAGS = -Wall -Wextra +CFLAGS ?= -g +WARN_CFLAGS = -Wall -Wextra -Wmissing-declarations -SCHERZO_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags) `pkg-config --cflags gtk+-2.0` +SCHERZO_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags) -I./mnemon `pkg-config --cflags gtk+-2.0 alsa` -SCHERZO_LDFLAGS = $(LDFLAGS) `pkg-config --libs gtk+-2.0` -ltalloc +SCHERZO_LDFLAGS = $(LDFLAGS) `pkg-config --libs gtk+-2.0 alsa` -ltalloc # The user has not set any verbosity, default to quiet mode and inform the # user how to enable verbose compiles. @@ -25,22 +27,22 @@ endif # Otherwise, print the full command line. quiet ?= $($(shell echo $1 | sed -e s'/ .*//')) -.deps/%.d: %.cpp $(global_deps) +.deps/%.d: %.c Makefile @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \ - $(CXX) -M $(CPPFLAGS) $(FINAL_CXXFLAGS) $< > $@.$$$$ 2>/dev/null ; \ + $(CC) -M $(CPPFLAGS) $(SCHERZO_CFLAGS) $< > $@.$$$$ 2>/dev/null ; \ sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ -DEPS := $(DEPS:%.cpp=.deps/%.d) +DEPS := $(scherzo_srcs:%.c=.deps/%.d) -include $(DEPS) -%.o: %.c $(global_deps) +%.o: %.c Makefile $(call quiet,CC $(CFLAGS)) -c $(SCHERZO_CFLAGS) $< -o $@ scherzo: $(scherzo_modules) $(call quiet,CC $(CFLAGS)) $^ $(SCHERZO_LDFLAGS) -o $@ -CLEAN := $(CLEAN) scherzo $(chorale_modules) +CLEAN := $(CLEAN) scherzo $(scherzo_modules) .PHONY : clean clean: