From 96085988a859fd6306e905f7cc796400a7a10311 Mon Sep 17 00:00:00 2001
From: Jaewon Choi <jaewon.james.choi@gmail.com>
Date: Sun, 17 Sep 2017 00:00:03 +0900
Subject: [PATCH] Add Makefile

---
 .gitignore |  1 -
 Makefile   | 25 +++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 Makefile

diff --git a/.gitignore b/.gitignore
index a5e4396..3902db1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -79,7 +79,6 @@ CMakeCache.txt
 CMakeFiles
 CMakeScripts
 Testing
-Makefile
 cmake_install.cmake
 install_manifest.txt
 compile_commands.json
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..a2d5da9
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,25 @@
+# For implementation
+CC=gcc -std=c99
+CFLAGS=-I./src -I./include
+LIB=
+OBJ=./src/utils.o
+
+%.o: %.c $(DEPS)
+	$(CC) -c -o $@ $< $(CFLAGS)
+
+mysh: $(OBJ)
+	$(CC) -o $@ $^ ./src/main.c $(CFLAGS)
+
+# For testing
+CXX=g++ -std=c++11
+TESTING_FLAGS=-I./tests/src -I./tests/include $(CFLAGS)
+TESTING_LIB=-lgtest -lgtest_main -L./tests/lib -lpthread $(LIB)
+TESTING_SRC=./tests/src/command_parsing_test.cc
+TESTING_EXE=mysh-test
+
+test: $(OBJ)
+	$(CXX) $(TESTING_FLAGS) -o $(TESTING_EXE) $(TESTING_SRC) $(OBJ) $(TESTING_LIB)
+	./$(TESTING_EXE)
+
+clean:
+	rm -f $(TESTING_EXE) $(OBJ) mysh ./src/main.o
-- 
GitLab