31 lines
363 B
Makefile
31 lines
363 B
Makefile
|
|
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) $(TEST)
|
|
|
|
run: $(TARGET)
|
|
./$(TARGET)
|
|
|
|
.PHONY: all clean run |