OPTI_FLAG = -O3
endif
+# Puting header files in the source directory is not the purpose of this INCLUDES variable
INCLUDES := $(INCLUDES) -I$(SRC_PATH) -I$(LIBRARY_PATH)
CFLAGS := $(CFLAGS) $(WARN_FLAGS) $(STD_FLAG) $(OPTI_FLAG) $(DEBUG_FLAG) $(INCLUDES)
LIBCFLAGS := -fPIC $(CFLAGS)
@echo "[LD ] $@"
@$(LD) $(CFLAGS) $(STATICLIBLDFLAGS) $^ $(LDLIBS) -o $@
-#$(BINARY_NAME).staticlocal: $(OBJS) $(LIBRARY_PATH)/$(LIBRARY_NAME).a
-# @echo "[LD ] $@"
-# @$(LD) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@
-
$(BINARY_NAME).dynamic: $(OBJS) $(LIBRARY_PATH)/$(LIBRARY_NAME).so
@echo "[LD ] $@"
@$(LD) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@
--- /dev/null
+/*
+ * =====================================================================================
+ *
+ * Filename: macros.h
+ *
+ * Description:
+ *
+ * Version: 1.0
+ * Created: 09/03/2017 15:28:46
+ * Revision: none
+ * Compiler: gcc
+ *
+ * Author: Jerome Benoit (fraggle), jerome.benoit@piment-noir.org
+ * Organization: Piment Noir
+ *
+ * =====================================================================================
+ */
+
+#ifndef MACROS_H
+#define MACROS_H
+
+/* definition to expand macro then apply to pragma message */
+#define VALUE_TO_STRING(x) #x
+#define VALUE(x) VALUE_TO_STRING(x)
+#define VAR_NAME_VALUE(var) #var "=" VALUE(var)
+
+#define ARRAY_SIZE(arr) ({typeof (arr) arr ## _is_a_pointer __attribute__((unused)) = {}; \
+ sizeof(arr) / sizeof(arr[0]);})
+
+#endif /* MACROS_H */