edits
[satune.git] / src / Makefile
index 1358986f1101a224e6de01201fb7719aa7776ffd..341a5dfa08f411c5e3fff7c5bbf777cfa70dbccb 100644 (file)
@@ -4,11 +4,14 @@ PHONY += directories
 MKDIR_P = mkdir -p
 OBJ_DIR = bin
 
-C_SOURCES := $(wildcard *.c) $(wildcard AST/*.c) $(wildcard Collections/*.c) $(wildcard Backend/*.c)
+C_SOURCES := $(wildcard *.c) $(wildcard AST/*.c) $(wildcard Collections/*.c) $(wildcard Backend/*.c) $(wildcard Encoders/*.c)
+
+HEADERS := $(wildcard *.h) $(wildcard AST/*.h) $(wildcard Collections/*.h) $(wildcard Backend/*.h) $(wildcard Encoders/*.h)
 
 OBJECTS := $(CPP_SOURCES:%.cc=$(OBJ_DIR)/%.o) $(C_SOURCES:%.c=$(OBJ_DIR)/%.o)
 
-CFLAGS += -IAST -ICollections -IBackend -I.
+CFLAGS := -Wall -g -O0
+CFLAGS += -IAST -ICollections -IBackend -I. -IEncoders
 LDFLAGS := -ldl -lrt -rdynamic
 SHARED := -shared
 
@@ -20,7 +23,7 @@ endif
 
 MARKDOWN := ../docs/Markdown/Markdown.pl
 
-all: directories $(LIB_SO)
+all: directories ${OBJ_DIR}/$(LIB_SO)
 
 directories: ${OBJ_DIR}
 
@@ -29,15 +32,16 @@ ${OBJ_DIR}:
        ${MKDIR_P} ${OBJ_DIR}/AST
        ${MKDIR_P} ${OBJ_DIR}/Collections
        ${MKDIR_P} ${OBJ_DIR}/Backend
+       ${MKDIR_P} ${OBJ_DIR}/Encoders
 
 debug: CFLAGS += -DCONFIG_DEBUG
 debug: all
 
 PHONY += docs
-docs: *.c *.cc *.h
+docs: $(C_SOURCES) $(HEADERS)
        doxygen
 
-$(LIB_SO): $(OBJECTS)
+${OBJ_DIR}/$(LIB_SO): $(OBJECTS)
        $(CC) -g $(SHARED) -o ${OBJ_DIR}/$(LIB_SO) $+ $(LDFLAGS)
 
 ${OBJ_DIR}/%.o: %.c
@@ -52,7 +56,7 @@ clean:
 
 PHONY += mrclean
 mrclean: clean
-       rm -rf docs
+       rm -rf ../docs
 
 PHONY += tags
 tags:
@@ -62,8 +66,7 @@ tabbing:
        uncrustify -c C.cfg --no-backup *.c
        uncrustify -c C.cfg --no-backup *.h */*.h
 
-.PHONY: $(PHONY)
+wc:
+       wc */*.c */*.h *.c *.h
 
-# A 1-inch margin PDF generated by 'pandoc'
-%.pdf: %.md
-       pandoc -o $@ $< -V header-includes='\usepackage[margin=1in]{geometry}'
+.PHONY: $(PHONY)