diff options
| author | Mosder <git@mosder.eu> | 2026-09-16 17:14:45 +0200 |
|---|---|---|
| committer | Mosder <git@mosder.eu> | 2026-09-16 17:14:45 +0200 |
| commit | 4af9b2a86ad5f5b7e59ba882aa527ecead75be0e (patch) | |
| tree | a9fb4de8159d99e90dd22e4b5f19f4798189b535 | |
| parent | 7e2a83a08d7b8bd8930aed0e9fcda614319d97f5 (diff) | |
fix: fixed macro error in Makefile (also added cleanup to static and shared targets)
| -rw-r--r-- | Makefile | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -14,22 +14,26 @@ INC_DIR=$(TARGET_PREFIX)/include INC_SUDO:=$(shell test -w $(INC_DIR) || echo sudo) CFLAGS=-std=c99 -Wall -Wextra -Wpedantic -fPIC -I./include -O2 -c -SRCS:=$(shell find src | grep \\.c$) +SRCS:=$(shell find src | grep "\.c$$") +CLEANUP=$(MAKE) clean TESTS_CFLAGS=-std=c99 -Wall -Wextra -Wpedantic -I$(INC_DIR) -Og -ggdb -c TESTS_LDFLAGS=-L$(LIB_DIR) -Wl,-rpath,$(LIB_DIR) -lmoslib -TESTS_SRCS:=$(shell find tests | grep \\.c$) +TESTS_SRCS:=$(shell find tests | grep "\.c$$") +both: CLEANUP=true both: clean shared static - $(MAKE) clean + @$(MAKE) clean shared: clean compile headers $(LIB_SUDO) $(CC) -shared *.o -o $(LIB_DIR)/libmoslib.so $(LIB_SUDO) strip -x $(LIB_DIR)/libmoslib.so + @$(CLEANUP) static: clean compile headers $(LIB_SUDO) $(AR) $(LIB_DIR)/libmoslib.a *.o $(LIB_SUDO) strip -S $(LIB_DIR)/libmoslib.a + @$(CLEANUP) headers: $(INC_SUDO) cp -r include/* $(INC_DIR) @@ -41,7 +45,7 @@ test: clean $(CC) $(TESTS_CFLAGS) $(TESTS_SRCS) $(CC) $(TESTS_LDFLAGS) *.o -o run_tests ./run_tests - $(MAKE) clean + @$(MAKE) clean clean: rm *.o run_tests 2>/dev/null || true |
