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

cleaner Makefile

parent 8835a1a9
...@@ -4,32 +4,30 @@ else ...@@ -4,32 +4,30 @@ else
LFLAGS = LFLAGS =
endif endif
OBJ_DIR := obi_objdir SOURCE_DIR := src
LIB_DIR := obi_libdir 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 OBJ_FILES = $(OBJ_DIR)/*.o
DYN_LIB_FILES = $(LIB_DIR)/libobi3.so DYN_LIB_FILES = $(LIB_DIR)/libobi3.so
default: $(DYN_LIB_FILES) all: $(DYN_LIB_FILES)
$(DYN_LIB_FILES): | $(LIB_DIR)
$(LIB_DIR): $(LIB_DIR):
mkdir -p $(LIB_DIR) mkdir -p $(LIB_DIR)
$(OBJ_FILES): | $(OBJ_DIR)
$(OBJ_DIR): $(OBJ_DIR):
mkdir -p $(OBJ_DIR) mkdir -p $(OBJ_DIR)
$(LIB_DIR)/libobi3.so: $(OBJ_FILES) $(DYN_LIB_FILES): $(OBJ_FILES) | $(LIB_DIR)
$(CC) -shared -o $@ $^ $(CC) -shared -o $@ $^
$(OBJ_DIR)/%.o: \ $(OBJ_FILES): | $(OBJ_DIR)
$(CC) $(LFLAGS) -fpic -c $(SOURCE_FILES)
$(CC) $(LFLAGS) -fpic -c src/libecoPCR/libapat/*.c src/libecoPCR/libthermo/*.c src/libecoPCR/*.c src/libjson/*.c src/*.c src/*.h
mv *.o $(OBJ_DIR) mv *.o $(OBJ_DIR)
clean: clean:
rm -rf $(LIB_DIR) rm -rf $(LIB_DIR)
rm -rf $(OBJ_DIR) rm -rf $(OBJ_DIR)
\ No newline at end of file
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