diff options
Diffstat (limited to 'ext/dsent/libutil/Makefile')
-rw-r--r-- | ext/dsent/libutil/Makefile | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/ext/dsent/libutil/Makefile b/ext/dsent/libutil/Makefile new file mode 100644 index 000000000..150028346 --- /dev/null +++ b/ext/dsent/libutil/Makefile @@ -0,0 +1,43 @@ + +# Define the directories that will be compiled +DIRS_TO_COMPILE := . \ + +DIRS = $(patsubst %,$(CURDIR)/%,$(DIRS_TO_COMPILE)) + +SRCS = $(foreach dir, $(DIRS), $(wildcard $(dir)/*.cc)) + +OBJS = $(SRCS:%.cc=%.o) + +DEF_FLAGS = + +ifdef LIBUTIL_IS_LOG + LIBUTIL_IS_LOG = true +else + LIBUTIL_IS_LOG = false +endif +DEF_FLAGS += -DLIBUTIL_IS_LOG=$(LIBUTIL_IS_LOG) + +INCLUDE_FLAGS = $(foreach dir, $(DIRS), -I$(dir)) +OPT_FLAGS = -O2 -g +WARN_FLAGS = -pedantic -Wall -W -Wextra -Werror +CXXFLAGS = $(OPT_FLAGS) $(WARN_FLAGS) $(INCLUDE_FLAGS) $(DEF_FLAGS) + +TARGET = $(CURDIR)/libutil.a + +all: $(TARGET) + +$(TARGET): $(OBJS) + ar rcs $@ $^ +#$(TARGET): $(OBJS) +# $(CXX) $(CXXFLAGS) $^ -o $(TARGET) + +%.o: %.cc + $(CXX) $(CXXFLAGS) -c $< -o $@ + +%/created: + mkdir -p $(dir $@) + touch $@ + +clean: + $(RM) -rf $(OBJS) $(TARGET) + |