7 C_SOURCES := $(wildcard *.c) $(wildcard AST/*.c) $(wildcard Collections/*.c) $(wildcard Backend/*.c) $(wildcard Encoders/*.c)
9 HEADERS := $(wildcard *.h) $(wildcard AST/*.h) $(wildcard Collections/*.h) $(wildcard Backend/*.h) $(wildcard Encoders/*.h)
11 OBJECTS := $(CPP_SOURCES:%.cc=$(OBJ_DIR)/%.o) $(C_SOURCES:%.c=$(OBJ_DIR)/%.o)
13 CFLAGS := -Wall -g -O0
14 CFLAGS += -IAST -ICollections -IBackend -I. -IEncoders
15 LDFLAGS := -ldl -lrt -rdynamic
19 ifeq ($(UNAME), Darwin)
21 SHARED := -Wl,-undefined,dynamic_lookup -dynamiclib
24 MARKDOWN := ../docs/Markdown/Markdown.pl
26 all: directories ${OBJ_DIR}/$(LIB_SO)
28 directories: ${OBJ_DIR}
32 ${MKDIR_P} ${OBJ_DIR}/AST
33 ${MKDIR_P} ${OBJ_DIR}/Collections
34 ${MKDIR_P} ${OBJ_DIR}/Backend
35 ${MKDIR_P} ${OBJ_DIR}/Encoders
37 debug: CFLAGS += -DCONFIG_DEBUG
44 docs: $(C_SOURCES) $(HEADERS)
47 ${OBJ_DIR}/$(LIB_SO): $(OBJECTS)
48 $(CC) -g $(SHARED) -o ${OBJ_DIR}/$(LIB_SO) $+ $(LDFLAGS)
51 $(CC) -fPIC -c $< -o $@ $(CFLAGS) -Wno-unused-variable
53 -include $(OBJECTS:%=$OBJ_DIR/.%.d)
69 uncrustify -c C.cfg --no-backup *.c */*.c
70 uncrustify -c C.cfg --no-backup *.h */*.h
73 wc */*.c */*.h *.c *.h