From 49410552c6157235017d4fc0af65af9709158ef5 Mon Sep 17 00:00:00 2001 From: CiberMonah Date: Sun, 22 Sep 2024 15:23:43 +0300 Subject: [PATCH] dont work on windows i dont know why --- .gitignore | 3 ++- makefile | 38 +++----------------------------------- 2 files changed, 5 insertions(+), 36 deletions(-) diff --git a/.gitignore b/.gitignore index 3efb721..c11b960 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ *. *.txt *.vscode -*.out \ No newline at end of file +*.out +*.exe diff --git a/makefile b/makefile index 18f0b7d..5e65b30 100644 --- a/makefile +++ b/makefile @@ -1,9 +1,6 @@ TARGET = Q2 - CXX = g++ -CXXFLAGS = -Wall -Wextra -std=c++11 - SRCS = main.cpp TEST = cache_test.cpp @@ -15,38 +12,10 @@ $(TARGET): $(OBJS) $(CXX) -o $@ $^ %.o: %.cpp - $(CXX) $(CXXFLAGS) -c $< -o $@ + $(CXX) $(CPPFLAGS) -c $< -o $@ test: - $(CXX) $(CXXFLAGS) $(TEST) -o cache_test - - -clean: - rm -f $(OBJS) $(TARGET) -run: $(TARGET) - ./$(TARGET) - -.PHONY: all clean run - -TARGET = Q2 -CXX = g++ -CXXFLAGS = -Wall -Wextra -std=c++11 - -SRCS = main.cpp -TEST = cache_test.cpp - -OBJS = $(SRCS:.cpp=.o) - -all: $(TARGET) - -$(TARGET): $(OBJS) - $(CXX) -o $@ $^ - -%.o: %.cpp - $(CXX) $(CXXFLAGS) -c $< -o $@ - -test: - $(CXX) $(CXXFLAGS) $(TEST) -o cache_test + $(CXX) $(CPPFLAGS) $(TEST) -o cache_test clean: rm -f $(OBJS) $(TARGET) cache_test @@ -54,12 +23,11 @@ clean: run: $(TARGET) ./$(TARGET) -# Windows compatibility for cleaning ifeq ($(OS), Windows_NT) clean: del /Q $(OBJS) $(TARGET) cache_test run: $(TARGET) - $(TARGET).exe + $(TARGET).exe endif .PHONY: all clean run test \ No newline at end of file