]> git.cworth.org Git - scherzo/blobdiff - Makefile
Fix high octave numbers (8+) to not be interpreted as 0.
[scherzo] / Makefile
index 3df2349670582e7e7aa607abbe0556beea729aab..841b1a1351346c0d1df1b9e0abf3fe1dd8fc4ad0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,20 @@
 all: scherzo
 
-scherzo_srcs =         \
+scherzo_srcs :=                \
+       mnemon/mnemon.c \
+       pitch.c         \
        scherzo.c       \
+       scherzo-key.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`
+SCHERZO_LDFLAGS = $(LDFLAGS) `pkg-config --libs gtk+-2.0 alsa` -ltalloc -lm
 
 # The user has not set any verbosity, default to quiet mode and inform the
 # user how to enable verbose compiles.
@@ -25,22 +29,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: