Commit 185a95e6 authored by Celine Mercier's avatar Celine Mercier

cleaner Makefile

parent 8835a1a9
......@@ -4,30 +4,28 @@ else
LFLAGS =
endif
OBJ_DIR := obi_objdir
LIB_DIR := obi_libdir
SOURCE_DIR := src
ENV_DIR := $(abspath .)
OBJ_DIR := $(ENV_DIR)/obi_objdir
LIB_DIR := $(ENV_DIR)/obi_libdir
SOURCE_FILES = $(SOURCE_DIR)/libecoPCR/libapat/*.c $(SOURCE_DIR)/libecoPCR/libthermo/*.c $(SOURCE_DIR)/libecoPCR/*.c $(SOURCE_DIR)/libjson/*.c $(SOURCE_DIR)/*.c
OBJ_FILES = $(OBJ_DIR)/*.o
DYN_LIB_FILES = $(LIB_DIR)/libobi3.so
default: $(DYN_LIB_FILES)
$(DYN_LIB_FILES): | $(LIB_DIR)
all: $(DYN_LIB_FILES)
$(LIB_DIR):
mkdir -p $(LIB_DIR)
$(OBJ_FILES): | $(OBJ_DIR)
$(OBJ_DIR):
mkdir -p $(OBJ_DIR)
$(LIB_DIR)/libobi3.so: $(OBJ_FILES)
$(DYN_LIB_FILES): $(OBJ_FILES) | $(LIB_DIR)
$(CC) -shared -o $@ $^
$(OBJ_DIR)/%.o: \
$(CC) $(LFLAGS) -fpic -c src/libecoPCR/libapat/*.c src/libecoPCR/libthermo/*.c src/libecoPCR/*.c src/libjson/*.c src/*.c src/*.h
$(OBJ_FILES): | $(OBJ_DIR)
$(CC) $(LFLAGS) -fpic -c $(SOURCE_FILES)
mv *.o $(OBJ_DIR)
clean:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment