initial commit
authorMatthew Owens <matthew@owens.tech>
Thu, 1 Oct 2020 12:36:39 +0000 (13:36 +0100)
committerMatthew Owens <matthew@owens.tech>
Thu, 1 Oct 2020 12:36:39 +0000 (13:36 +0100)
.gitignore [new file with mode: 0644]
.gitmodules [new file with mode: 0644]
Makefile [new file with mode: 0644]
clogs [new submodule]
src/main.c [new file with mode: 0644]
src/main.o [new file with mode: 0644]
vector [new submodule]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..2e4059b
--- /dev/null
@@ -0,0 +1,2 @@
+pong
+*.exe
diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..313b5b1
--- /dev/null
@@ -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 (file)
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 (submodule)
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 (file)
index 0000000..0c0ce22
--- /dev/null
@@ -0,0 +1,10 @@
+#include <stdio.h>
+#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 (file)
index 0000000..afd1b90
Binary files /dev/null and b/src/main.o differ
diff --git a/vector b/vector
new file mode 160000 (submodule)
index 0000000..4f99e38
--- /dev/null
+++ b/vector
@@ -0,0 +1 @@
+Subproject commit 4f99e3836438b7a36da9a9da77d80e3d11b6d3b2