summaryrefslogtreecommitdiffhomepage
path: root/CompilerDriver/makefile
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2023-12-30 23:39:37 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2023-12-30 23:39:37 +0100
commit263915832993dd12beee10e204f9ebcc6c786ed2 (patch)
tree862e51208a99c35746e574a76564a4532b3a4a49 /CompilerDriver/makefile
Meta: initial commit of WestCo optimized toolchain.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'CompilerDriver/makefile')
-rw-r--r--CompilerDriver/makefile59
1 files changed, 59 insertions, 0 deletions
diff --git a/CompilerDriver/makefile b/CompilerDriver/makefile
new file mode 100644
index 0000000..91ab478
--- /dev/null
+++ b/CompilerDriver/makefile
@@ -0,0 +1,59 @@
+ #
+ # ========================================================
+ #
+ # C++Kit
+ # Copyright WestCo, all rights reserved.
+ #
+ # ========================================================
+ #
+
+LINK_CC=g++ -std=c++20
+LINK_INC=-I../ -I../C++Kit
+LINK_SRC=ld.cxx
+LINK_OUTPUT=bin/ld
+
+PP_SRC=cpp.cxx
+PP_OUTPUT=bin/cpp
+
+CC2_OUTPUT=bin/cpp2
+CC2_SRC=cc2/source/cppfront.cpp
+
+CC_SRC=ccplus.cxx ../C++Kit/StdKit/*.cpp ../C++Kit/AsmKit/*.cpp
+CC_OUTPUT=bin/ccplus
+
+CC_SRC=cc.cxx ../C++Kit/StdKit/*.cpp ../C++Kit/AsmKit/*.cpp
+CC_OUTPUT=bin/cc
+
+CXX_SRC=ccplus.cxx ../C++Kit/StdKit/*.cpp ../C++Kit/AsmKit/*.cpp
+CXX_OUTPUT=bin/ccplus
+
+MASM_SRC=masm.cxx ../C++Kit/StdKit/*.cpp ../C++Kit/AsmKit/*.cpp
+MASM_OUTPUT=bin/masm
+
+.PHONY: all
+all: cxx
+ @echo "[make] done build"
+
+.PHONY: cxx
+cxx: ld
+ $(LINK_CC) $(LINK_INC) $(PP_SRC) -o $(PP_OUTPUT)
+ $(LINK_CC) $(LINK_INC) $(CC_SRC) -o $(CC_OUTPUT)
+ $(LINK_CC) $(LINK_INC) $(CC2_SRC) -o $(CC2_OUTPUT)
+ $(LINK_CC) $(LINK_INC) $(CXX_SRC) -o $(CXX_OUTPUT)
+ $(LINK_CC) $(LINK_INC) $(MASM_SRC) -o $(MASM_OUTPUT)
+
+.PHONY: ld
+ld:
+ $(LINK_CC) $(LINK_INC) $(LINK_SRC) -o $(LINK_OUTPUT)
+
+.PHONY: help
+help:
+ @echo "cxx - C compiler driver"
+ @echo "ld - Linker"
+
+.PHONY: clean
+clean:
+ rm bin/$(MKCDFS_OUTPUT)
+ rm bin/$(CC_OUTPUT)
+ rm bin/$(PP_OUTPUT)
+ rm bin/$(LINK_OUTPUT) \ No newline at end of file