From da6877b8be4ecd6a27e076766bf0b6b6f02959cd Mon Sep 17 00:00:00 2001 From: JP Appel Date: Sun, 21 Jul 2024 14:40:09 -0400 Subject: FEAT/DOC: add static target, build/usage instructions --- Makefile | 12 ++++++++---- README.md | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 699ddef..c0624ae 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,23 @@ CC := gcc CFLAGS := -Wall +DEBUG_FLAGS := -ggdb -Og SRCS := eztester.c OBJS := eztester.o eztester_debug.o STATIC_LIBS := libeztester.a libeztester_debug.a +DYNAMIC_LIBS := libeztester.a libeztester_debug.a -.PHONY: all clean +.PHONY: all static clean all: $(STATIC_LIBS) -eztester.o: eztester.c +static: $(STATIC_LIBS) + +%.o: %.c $(CC) -c $(CFLAGS) -O3 -o $@ $< -eztester_debug.o: eztester.c - $(CC) -c -ggdb -Og $(CFLAGS) -o $@ $< +%_debug.o: %.c + $(CC) -c $(DEBUG_FLAGS) $(CFLAGS) -o $@ $< lib%.a: %.o ar rcs $@ $< diff --git a/README.md b/README.md index df1a809..a4f9495 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,42 @@ A barebones testing library for C +## Build + +Note this has only been tested on my machine + +* Void Linux x86_64 glibc + +```bash +make static # builds libeztester.a and libeztester_debug.a +``` + +### Dependencies + +* None ☺️ + +## Usage + +### Static + +After building, copy the static libraries into your project + +```bash +cp libeztester.a libeztester_debug.a $YOUR_PROJECT_DIRECORY/libs +``` + +When building make sure to add `-Llibs -leztester` to your linker flags + +For example: +```bash +gcc -o bird_tester tests/bird_tests.c src/bird.c -Llibs -leztester +``` + + +### Dynamic + +### Header + ## TODO * [ ] makefile -- cgit v1.2.3