summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile41
1 files changed, 19 insertions, 22 deletions
diff --git a/Makefile b/Makefile
index 0802007..b0835fd 100644
--- a/Makefile
+++ b/Makefile
@@ -1,31 +1,28 @@
+BUILD_PROFILE = release
-SRC_DIR = src
-BUILD_DIR = build
-OBJ_DIR = $(BUILD_DIR)/artifacts
-INCLUDE_DIR = ./include
+.PHONY: build debug clean format install install_debug uninstall run
-SRCS = $(notdir $(wildcard $(SRC_DIR)/*.c))
-OBJS = $(addsuffix .o, $(basename $(SRCS)))
+build:
+ BUILD_PROFILE=$(BUILD_PROFILE) $(MAKE) -f Makefile.logic
-CFLAGS ?= -Werror -Wall
+debug: BUILD_PROFILE = debug
+debug: build
-build: build_dir $(OBJS)
- $(CC) -shared -o $(BUILD_DIR)/libopensmarts.so $(addprefix $(OBJ_DIR)/, $(OBJS))
+clean:
+ BUILD_PROFILE=$(BUILD_PROFILE) $(MAKE) -f Makefile.logic clean
-install: build
- install -m 755 ./build/libopensmarts.so /usr/lib/libopensmarts.so
- rm -rf /usr/include/osm
- mkdir -p /usr/include/osm
- cp -r ./include/osm /usr/include
+format:
+ $(MAKE) -f Makefile.logic format
-remove:
- rm -rf /usr/include/osm
- rm -rf /usr/lib/libopensmarts.so
+install:
+ BUILD_PROFILE=$(BUILD_PROFILE) $(MAKE) -f Makefile.logic install
-%.o: $(SRC_DIR)/%.c
- $(CC) $(CFLAGS) -c -fpic -I$(INCLUDE_DIR) -o $(BUILD_DIR)/artifacts/$@ $<
+install_debug: BUILD_PROFILE = debug
+install_debug: install
-build_dir:
- mkdir -p $(BUILD_DIR)
- mkdir -p $(OBJ_DIR)
+uninstall:
+ $(MAKE) -f Makefile.logic uninstall
+
+run:
+ $(MAKE) -f Makefile.logic run