aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Makefile34
-rw-r--r--src/lib/lib.c3
-rw-r--r--src/main.c7
4 files changed, 46 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..43383fe
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+# Build files
+build/
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..bd731f6
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,34 @@
+PKGS=libtiff-4 raylib
+EXE=prog
+BUILD_DIR=build/
+OBJ_DIR=$(BUILD_DIR)obj/
+SRC_DIR=src/
+INC_DIR=include/
+SRCS=$(shell find $(SRC_DIR) -iname \*.c)
+OBJS_sub=$(subst $(SRC_DIR),$(OBJ_DIR),$(SRCS))
+OBJS=$(OBJS_sub:.c=.o)
+OBJ_DIRS_sub=$(shell find $(SRC_DIR) -type d)
+OBJ_DIRS=$(subst $(SRC_DIR),$(OBJ_DIR),$(OBJ_DIRS_sub))
+
+CFLAGS=
+CFLAGS+=$(shell pkgconf --cflags $(PKGS))
+CFLAGS+=-I$(INC_DIR)
+
+LDFLAGS=
+LDFLAGS+=$(shell pkgconf --libs $(PKGS))
+
+default: clean build
+
+.PHONY: clean build
+
+build: $(BUILD_DIR)$(EXE)
+
+$(BUILD_DIR)$(EXE): $(OBJS)
+ gcc -o $@ $(LDFLAGS) $^
+
+$(OBJ_DIR)%.o: $(SRC_DIR)%.c
+ gcc -o $@ $(CFLAGS) -c $<
+
+clean:
+ -rm -rf $(OBJ_DIR) $(BUILD_DIR)
+ @mkdir -p $(OBJ_DIR) $(BUILD_DIR) $(OBJ_DIRS)
diff --git a/src/lib/lib.c b/src/lib/lib.c
new file mode 100644
index 0000000..ea971fd
--- /dev/null
+++ b/src/lib/lib.c
@@ -0,0 +1,3 @@
+#include <stdint.h>
+
+const uint32_t SIZE = 5;
diff --git a/src/main.c b/src/main.c
new file mode 100644
index 0000000..136db02
--- /dev/null
+++ b/src/main.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+int main()
+{
+ return 0;
+}