diff --git a/.gitignore b/.gitignore index 5dfa675..6b9ebd9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -gearlib +libgearlib.a obj/ +test/*.exe diff --git a/Makefile b/Makefile index e29d2f9..3f72e2d 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,15 @@ -BINARY=gearlib +LIBRARY=libgearlib.a -CC=gcc +CC:=tcc +AR=$(CC) -ar CFLAGS=-O3 -Iinclude -g LDFLAGS=-lglfw -lm CFILES=$(shell cd src && find -L * -type f -name '*.c') OBJ=$(addprefix obj/, $(CFILES:.c=.o)) -$(BINARY): objdir $(OBJ) Makefile - $(CC) $(OBJ) $(LDFLAGS) -o $@ +$(LIBRARY): objdir $(OBJ) Makefile + $(CC) -ar rcs $(LIBRARY) $(OBJ) obj/%.o: src/%.c $(CC) $(CFLAGS) -c $< -o $@ @@ -16,12 +17,10 @@ obj/%.o: src/%.c objdir: mkdir -p obj -run: $(BINARY) - ./$(BINARY) - -debug: $(BINARY) - gdb $(BINARY) +run: $(LIBRARY) + make -C test main + cd test && ./main clean: - rm -rf $(OBJ) $(BINARY) - + rm -rf $(OBJ) $(LIBRARY) + make -C test clean diff --git a/implementations.o b/implementations.o deleted file mode 100644 index 222d6e1..0000000 Binary files a/implementations.o and /dev/null differ diff --git a/src/implementations.c b/src/implementations.c index 48bc3c9..2716ca7 100644 --- a/src/implementations.c +++ b/src/implementations.c @@ -1,6 +1,10 @@ #define SL_IMPLEMENTATION #include +#define STBI_NO_SIMD #define STBI_FAILURE_USERMSG #define STB_IMAGE_IMPLEMENTATION #include + +#define RAYMATH_IMPLEMENTATION +#include diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 0000000..dd67e44 --- /dev/null +++ b/test/Makefile @@ -0,0 +1,16 @@ +CC=tcc + +CFLAGS=-O3 -I../include +LDFLAGS=-lglfw -L ../ -lgearlib -lm + +CFILES=$(shell find -L * -type f -name '*.c') +BINARIES=$(CFILES:.c=) + +all: $(BINARIES) + +%: %.c + $(CC) $< -o $@ $(CFLAGS) $(LDFLAGS) + +clean: + rm -rf $(BINARIES) + diff --git a/assets/cat.png b/test/assets/cat.png similarity index 100% rename from assets/cat.png rename to test/assets/cat.png diff --git a/assets/cuddle.png b/test/assets/cuddle.png similarity index 100% rename from assets/cuddle.png rename to test/assets/cuddle.png diff --git a/assets/parrots.png b/test/assets/parrots.png similarity index 100% rename from assets/parrots.png rename to test/assets/parrots.png diff --git a/assets/quad.frag b/test/assets/quad.frag similarity index 100% rename from assets/quad.frag rename to test/assets/quad.frag diff --git a/assets/quad.vert b/test/assets/quad.vert similarity index 100% rename from assets/quad.vert rename to test/assets/quad.vert diff --git a/assets/texture.frag b/test/assets/texture.frag similarity index 100% rename from assets/texture.frag rename to test/assets/texture.frag diff --git a/assets/texture.vert b/test/assets/texture.vert similarity index 100% rename from assets/texture.vert rename to test/assets/texture.vert diff --git a/test/main b/test/main new file mode 100755 index 0000000..109f386 Binary files /dev/null and b/test/main differ diff --git a/src/main.c b/test/main.c similarity index 100% rename from src/main.c rename to test/main.c