diff options
| author | Kai Gunger <kgunger12@gmail.com> | 2025-09-25 00:37:24 -0400 | 
|---|---|---|
| committer | Kai Gunger <kgunger12@gmail.com> | 2025-09-25 00:37:24 -0400 | 
| commit | b9c157b8687c3e2d0d9a40b4f5c5191e34b728d4 (patch) | |
| tree | 070761da7e34cc13261299d1d355a11bf67ce306 /Makefile | |
| parent | 809e7e837b0940081bb0729c6e84885e035f073f (diff) | |
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 41 | 
1 files changed, 19 insertions, 22 deletions
@@ -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  |