33 lines
447 B
Makefile
33 lines
447 B
Makefile
TARGET = Q2
|
|
CXX = g++
|
|
|
|
SRCS = main.cpp
|
|
TEST = cache_test.cpp
|
|
|
|
OBJS = $(SRCS:.cpp=.o)
|
|
|
|
all: $(TARGET)
|
|
|
|
$(TARGET): $(OBJS)
|
|
$(CXX) -o $@ $^
|
|
|
|
%.o: %.cpp
|
|
$(CXX) $(CPPFLAGS) -c $< -o $@
|
|
|
|
test:
|
|
$(CXX) $(CPPFLAGS) $(TEST) -o cache_test
|
|
|
|
clean:
|
|
rm -f $(OBJS) $(TARGET) cache_test
|
|
|
|
run: $(TARGET)
|
|
./$(TARGET)
|
|
|
|
ifeq ($(OS), Windows_NT)
|
|
clean:
|
|
del /Q $(OBJS) $(TARGET) cache_test
|
|
run: $(TARGET)
|
|
$(TARGET).exe
|
|
endif
|
|
|
|
.PHONY: all clean run test |