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 += -IAST -ICollections -IBackend -I. -IEncoders
14 LDFLAGS := -ldl -lrt -rdynamic
18 ifeq ($(UNAME), Darwin)
20 SHARED := -Wl,-undefined,dynamic_lookup -dynamiclib
23 MARKDOWN := ../docs/Markdown/Markdown.pl
25 all: directories $(LIB_SO)
27 directories: ${OBJ_DIR}
31 ${MKDIR_P} ${OBJ_DIR}/AST
32 ${MKDIR_P} ${OBJ_DIR}/Collections
33 ${MKDIR_P} ${OBJ_DIR}/Backend
34 ${MKDIR_P} ${OBJ_DIR}/Encoders
36 debug: CFLAGS += -DCONFIG_DEBUG
40 docs: $(C_SOURCES) $(HEADERS)
44 $(CC) -g $(SHARED) -o ${OBJ_DIR}/$(LIB_SO) $+ $(LDFLAGS)
47 $(CC) -fPIC -c $< -o $@ $(CFLAGS) -Wno-unused-variable
49 -include $(OBJECTS:%=$OBJ_DIR/.%.d)
65 uncrustify -c C.cfg --no-backup *.c
66 uncrustify -c C.cfg --no-backup *.h */*.h
69 wc */*.c */*.h *.c *.h