aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile12
-rw-r--r--README.md36
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