diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 37 |
1 files changed, 19 insertions, 18 deletions
@@ -1,27 +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 + +format: + $(MAKE) -f Makefile.logic format install: - install -m 755 ./build/libopensmarts.so /usr/lib64/libopensmarts.so - rm -rf /usr/include/osm - mkdir -p /usr/include/osm - cp -r ./include/osm /usr/include + BUILD_PROFILE=$(BUILD_PROFILE) $(MAKE) -f Makefile.logic install + +install_debug: BUILD_PROFILE = debug +install_debug: install -%.o: $(SRC_DIR)/%.c - $(CC) $(CFLAGS) -c -fpic -I$(INCLUDE_DIR) -o $(BUILD_DIR)/artifacts/$@ $< +uninstall: + $(MAKE) -f Makefile.logic uninstall -build_dir: - mkdir -p $(BUILD_DIR) - mkdir -p $(OBJ_DIR) +run: + $(MAKE) -f Makefile.logic run |