From 3bc82d22f6558bdb84bd77387eb032364692a2d5 Mon Sep 17 00:00:00 2001 From: avinal <185067@nith.ac.in> Date: Mon, 10 Aug 2020 12:16:25 +0530 Subject: [PATCH] All tests working and compilation working --- Makefile | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 3de7108..248ef27 100644 --- a/Makefile +++ b/Makefile @@ -1,24 +1,27 @@ CXX = g++ -CXXFLAGS = -Wall -Wextra -pedantic-errors -std=c++17 +STDVERSION = -std=c++17 +WARNINGS = -pedantic -Wall -Wfatal-errors -Wextra -Wno-unused-parameter -Wno-unused-variable -OBJECTS = build/parser.o build/code.o build/symbol_table.o TARGET = assembler - -all: $(TARGET) +OBJ_DIR = build +OBJECTS = build/symbol_table.o build/parser.o +TEST_OBJS = build/parser_test.o +all:$(TARGET) $(TARGET): $(OBJECTS) - $(CXX) $(CXXFLAGS) -o $(TARGET) src/Main.cpp $(OBJECTS) + $(CXX) $(WARNINGS) $(STDVERSION) -o $(TARGET) src/Main.cpp $(OBJECTS) -build/parser.o:src/parser.cpp include/parser.hpp - $(CXX) $(CXXFLAGS) -c src/parser.cpp -o build/parser.o - -build/code.o:src/code.cpp include/code.hpp - $(CXX) $(CXXFLAGS) -c src/code.cpp -o build/code.o +build/parser.o: src/parser.cpp include/parser.hpp + $(CXX) $(WARNINGS) $(STDVERSION) -c src/parser.cpp -o build/parser.o build/symbol_table.o:src/symbol_table.cpp include/symbol_table.hpp - $(CXX) $(CXXFLAGS) -c src/symbol_table.cpp -o build/symbol_table.o + $(CXX) $(STDVERSION) -c src/symbol_table.cpp -o build/symbol_table.o + + +test: + $(CXX) $(STDVERSION) tests/*.cpp tests/catch/catch_main.cpp src/parser.cpp src/symbol_table.cpp -o test clean: - rm -f build/* \ No newline at end of file + rm -rf build/*.o $(TARGET) test \ No newline at end of file