2024-09-13 06:02:36 +02:00
|
|
|
TARGET = Q2
|
2024-09-21 10:51:04 +02:00
|
|
|
|
2024-09-13 06:02:36 +02:00
|
|
|
CXX = g++
|
2024-09-21 10:51:04 +02:00
|
|
|
|
2024-09-13 06:02:36 +02:00
|
|
|
CXXFLAGS = -Wall -Wextra -std=c++11
|
2024-09-21 10:51:04 +02:00
|
|
|
|
2024-09-15 17:40:48 +02:00
|
|
|
SRCS = main.cpp
|
|
|
|
TEST = cache_test.cpp
|
2024-09-13 06:02:36 +02:00
|
|
|
|
2024-09-21 10:51:04 +02:00
|
|
|
OBJS = $(SRCS:.cpp=.o)
|
2024-09-20 22:29:56 +02:00
|
|
|
|
2024-09-13 06:02:36 +02:00
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
$(TARGET): $(OBJS)
|
2024-09-21 10:51:04 +02:00
|
|
|
$(CXX) -o $@ $^
|
2024-09-13 06:02:36 +02:00
|
|
|
|
|
|
|
%.o: %.cpp
|
2024-09-21 10:51:04 +02:00
|
|
|
$(CXX) $(CXXFLAGS) -c $< -o $@
|
2024-09-13 06:02:36 +02:00
|
|
|
|
2024-09-15 17:40:48 +02:00
|
|
|
test:
|
2024-09-21 10:51:04 +02:00
|
|
|
$(CXX) $(CXXFLAGS) $(TEST) -o cache_test
|
2024-09-15 17:40:48 +02:00
|
|
|
|
2024-09-21 15:19:03 +02:00
|
|
|
|
2024-09-21 10:51:04 +02:00
|
|
|
clean:
|
|
|
|
rm -f $(OBJS) $(TARGET)
|
2024-09-13 06:02:36 +02:00
|
|
|
run: $(TARGET)
|
2024-09-21 10:51:04 +02:00
|
|
|
./$(TARGET)
|
2024-09-13 06:02:36 +02:00
|
|
|
|
2024-09-22 02:25:10 +02:00
|
|
|
.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
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(OBJS) $(TARGET) cache_test
|
|
|
|
|
|
|
|
run: $(TARGET)
|
|
|
|
./$(TARGET)
|
|
|
|
|
|
|
|
# Windows compatibility for cleaning
|
|
|
|
ifeq ($(OS), Windows_NT)
|
|
|
|
clean:
|
|
|
|
del /Q $(OBJS) $(TARGET) cache_test
|
|
|
|
run: $(TARGET)
|
|
|
|
$(TARGET).exe
|
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: all clean run test
|