From: Matthew Owens Date: Thu, 1 Oct 2020 12:36:39 +0000 (+0100) Subject: initial commit X-Git-Url: https://git.owens.tech/assets/static/gitweb.css/assets/static/gitweb.css/git?a=commitdiff_plain;h=f537b29d86d135446afcad633c7497ee7d0d524a;p=pong.git initial commit --- f537b29d86d135446afcad633c7497ee7d0d524a diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2e4059b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +pong +*.exe diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..313b5b1 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "vector"] + path = vector + url = git@owens.tech:cecse/vector.git +[submodule "clogs"] + path = clogs + url = git@owens.tech:cecse/clogs.git diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..be9e688 --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +TARGET = pong +LIBS = -lm -D_REENTRANT -lGL -lGLEW -lSDL2 -lSDL2_image -pthread + +CC = gcc +CFLAGS = -g -Wall -I/usr/include/SDL2 -Isrc + +.PHONY: default all clean + +default: $(TARGET) +all: default + +MODULES := vector clogs +export VECTOR_DIR=vector/src +export CLOG_DIR=clogs/src + +include $(patsubst %, %/module.mk, $(MODULES)) + +CFLAGS += -I$(VECTOR_DIR) -I$(CLOG_DIR) + +#OBJ += $(patsubst src/%.c, src/%.o, $(wildcard src/*.c)) +HEADERS += $(wildcard src/*.h) +SRC += $(wildcard src/*.c) +OBJ := $(SRC:.c=.o) + +.PRECIOUS: $(TARGET) $(OBJ) + +$(TARGET): $(OBJ) + $(CC) $(OBJ) -Wall $(LIBS) -o $@ + -./$(TARGET) + +clean: + rm -f src/*.o + rm -f $(TARGET) + +output: + @echo "SRC: $(SRC)" + @echo "OBJ: $(OBJ)" diff --git a/clogs b/clogs new file mode 160000 index 0000000..8020a1e --- /dev/null +++ b/clogs @@ -0,0 +1 @@ +Subproject commit 8020a1e5b08b570e4ac20837cc67a0e8da6700a0 diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..0c0ce22 --- /dev/null +++ b/src/main.c @@ -0,0 +1,10 @@ +#include +#include "clogs.h" +#include "vector.h" + +int main() +{ + printf("hello, world\n"); + COUT("TEST"); + return 0; +} diff --git a/src/main.o b/src/main.o new file mode 100644 index 0000000..afd1b90 Binary files /dev/null and b/src/main.o differ diff --git a/vector b/vector new file mode 160000 index 0000000..4f99e38 --- /dev/null +++ b/vector @@ -0,0 +1 @@ +Subproject commit 4f99e3836438b7a36da9a9da77d80e3d11b6d3b2