diff options
| author | Tristan Riehs <tristan.riehs@inria.fr> | 2026-04-26 16:57:47 +0200 |
|---|---|---|
| committer | Tristan Riehs <tristan.riehs@inria.fr> | 2026-04-26 16:57:47 +0200 |
| commit | 0c41b30e1534e4e23a1ff15eca50247579071d83 (patch) | |
| tree | 72556ee1cce3c978eeb9655f365b7f67c97d0673 /Makefile | |
Yet another project that will likely never be used by anyone
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 32 |
1 files changed, 32 insertions, 0 deletions
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 |
