From 0c41b30e1534e4e23a1ff15eca50247579071d83 Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Sun, 26 Apr 2026 16:57:47 +0200 Subject: Yet another project that will likely never be used by anyone --- Makefile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b3fd009 --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +CC ?= cc +CFLAGS ?= -O2 -g +PREFIX ?= /usr/local + +__CFLAGS := -I./include/ -std=c99 -D_POSIX_C_SOURCE=200809L -Wall -Wextra + +all: libuconfig.a test/uconfig_test + +libuconfig.a: src/uconfig.o + ar rcs $@ $^ + +src/uconfig.o: src/uconfig.c include/uconfig.h + $(CC) $(__CFLAGS) -c -fPIC $(CFLAGS) -o $@ $< + +test/uconfig_test: test/uconfig_test.o libuconfig.a + $(CC) -o $@ $^ + +test/uconfig_test.o: test/uconfig_test.c include/uconfig.h + $(CC) $(__CFLAGS) -c -o $@ $< + +check: all + ./test/uconfig_test + +clean: + rm -f libuconfig.a src/uconfig.o + +install: libuconfig.a + mkdir -p $(PREFIX)/lib $(PREFIX)/include + cp libuconfig.a $(PREFIX)/lib/ + cp include/uconfig.h $(PREFIX)/include/ + +.PHONY: all check clean install -- cgit v1.2.3