summaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorFabrice <fabrice@schaub-dev.xyz>2026-03-01 17:50:59 +0100
committerFabrice <fabrice@schaub-dev.xyz>2026-03-01 17:50:59 +0100
commitdabfe3f7a3f165a77d1301a0826bdb7a1049317d (patch)
tree6b2811097fd35eff33db224fc6a8d2e095ae8a5b /makefile
init
Diffstat (limited to 'makefile')
-rw-r--r--makefile41
1 files changed, 41 insertions, 0 deletions
diff --git a/makefile b/makefile
new file mode 100644
index 0000000..2bdec21
--- /dev/null
+++ b/makefile
@@ -0,0 +1,41 @@
+.SILENT:
+.DEFAULT_GOAL := all
+
+# ====== Configurations and Binaries ====== #
+CXX := clang++
+RM := rm -f
+PRINTF := printf
+
+# ====== Flags ====== #
+CCXX_FLAGS := \
+ -Wall -Wextra -Werror -pedantic \
+ -MMD -MP
+
+CXX_FLAGS := -std=c++14 -nostdlib++ \
+ $(CCXX_FLAGS) -fno-rtti -fno-exceptions
+
+LD_FLAGS :=
+
+# ====== Sources ====== #
+TOP_DIR := .
+SRC_DIR := $(TOP_DIR)/src
+
+VOIDC_O := $(SRC_DIR)/voidc.o
+VOIDC_D := $(SRC_DIR)voidc.d
+VOIDC := $(TOP_DIR)/voidc
+
+# ====== Rules ====== #
+.PHONY: all
+all: $(VOIDC)
+
+$(VOIDC): $(VOIDC_O)
+ $(PRINTF) " CXXLD %s\n" $<
+ $(CXX) $< -o $@ $(LD_FLAGS)
+
+%.o: %.cc
+ $(PRINTF) " CXX %s\n" $<
+ $(CXX) $< -o $@ -c $(CXX_FLAGS)
+
+.PHONY: clean
+clean:
+ $(RM) $(VOIDC_O) $(VOIDC_D) $(VOIDC)