From f78f66cf9a04352f695e7b3d8f406d55eab3d21e Mon Sep 17 00:00:00 2001 From: hkc Date: Sun, 30 Jan 2022 23:04:56 +0300 Subject: [PATCH] Ah shit, here we go again --- .gitignore | 2 ++ .gitmodules | 3 +++ Makefile | 18 ++++++++++++++++++ obj/.gitkeep | 0 src/main.c | 11 +++++++++++ src/stb_image.c | 2 ++ src/stb_image.h | 2 ++ thirdparty/stb | 1 + 8 files changed, 39 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 Makefile create mode 100644 obj/.gitkeep create mode 100644 src/main.c create mode 100644 src/stb_image.c create mode 100644 src/stb_image.h create mode 160000 thirdparty/stb diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a591626 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +asciify +obj/*.o diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..c962b6b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "thirdparty/stb"] + path = thirdparty/stb + url = https://github.com/nothings/stb/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7f728ef --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +CFLAGS := -Wall -Wextra -Werror -pedantic -std=c99 +CLIBS := -lm +INCLUDES := -Isrc +OBJECTS := obj/stb_image.o + +all: lib asciify + +lib: $(OBJECTS) + +clean: + $(RM) obj/* + +asciify: lib + $(CC) $(CFLAGS) src/main.c $(INCLUDES) $(OBJECTS) $(CLIBS) -o ./asciify + +obj/%.o: src/%.c + $(CC) $(CFLAGS) $^ $(INCLUDES) -c -o $@ + diff --git a/obj/.gitkeep b/obj/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..8cb8cce --- /dev/null +++ b/src/main.c @@ -0,0 +1,11 @@ +#include +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; + (void)argv; + printf("ah shit, here we go again\n"); + return 0; +} diff --git a/src/stb_image.c b/src/stb_image.c new file mode 100644 index 0000000..9779bf8 --- /dev/null +++ b/src/stb_image.c @@ -0,0 +1,2 @@ +#define STB_IMAGE_IMPLEMENTATION +#include "./stb_image.h" diff --git a/src/stb_image.h b/src/stb_image.h new file mode 100644 index 0000000..b94f0ab --- /dev/null +++ b/src/stb_image.h @@ -0,0 +1,2 @@ +#include "../thirdparty/stb/stb_image.h" + diff --git a/thirdparty/stb b/thirdparty/stb new file mode 160000 index 0000000..af1a5bc --- /dev/null +++ b/thirdparty/stb @@ -0,0 +1 @@ +Subproject commit af1a5bc352164740c1cc1354942b1c6b72eacb8a