diff options
| author | Mosder <xmosder12@gmail.com> | 2026-07-30 17:26:31 +0200 |
|---|---|---|
| committer | Mosder <xmosder12@gmail.com> | 2026-07-30 17:26:31 +0200 |
| commit | 95ead7e764df405452fcbb04380f836e947e8f55 (patch) | |
| tree | 556b06c941fc42c08a721bc818388e9a9c962706 /Makefile | |
feat: initialized the repo and added some blank files
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..bfdd2f0 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +CC=gcc +CFLAGS=-std=c99 -Wall -Wextra -I./include -O2 -s +CFLAGS_TEST=-std=c99 -Wall -Wextra -Og -g -fsanitize=address +AR=ar rcs + +both: shared static clean + +shared: compile headers + $(CC) -shared *.o -o libmoslib.so + sudo mv libmoslib.so /usr/local/lib + +static: compile headers + $(AR) libmoslib.a *.o + sudo mv libmoslib.a /usr/local/lib + +headers: + sudo cp -r include/* /usr/local/include + +compile: memory structures + $(CC) $(CFLAGS) -c src/tests.c + +memory: + $(CC) $(CFLAGS) -c src/mem/alloc.c + +structures: + $(CC) $(CFLAGS) -c src/ds/array.c + +test: + $(CC) $(CFLAGS_TEST) tests/main.c -o run_tests + ./run_tests + rm run_tests + +.PHONY: clean +clean: + rm *.o |
