39 lines
805 B
Makefile
39 lines
805 B
Makefile
# Makefile for Mock Driver
|
|
|
|
CC = gcc
|
|
CFLAGS = -Wall -Wextra -g -O0
|
|
SRCS = test_mock_driver.c mock_driver.c
|
|
OBJS = $(SRCS:.c=.o)
|
|
TARGET = test_mock_driver
|
|
|
|
# Test programs
|
|
TEST_ALL = test_all_pages
|
|
TEST_ALL_SRCS = test_all_pages.c mock_driver.c
|
|
|
|
all: $(TARGET) $(TEST_ALL)
|
|
|
|
$(TARGET): test_mock_driver.o mock_driver.o
|
|
$(CC) $(CFLAGS) -o $@ test_mock_driver.o mock_driver.o
|
|
|
|
$(TEST_ALL): $(TEST_ALL_SRCS)
|
|
$(CC) $(CFLAGS) -o $@ $(TEST_ALL_SRCS)
|
|
|
|
test_mock_driver.o: test_mock_driver.c mock_driver.h
|
|
mock_driver.o: mock_driver.c mock_driver.h
|
|
test_all_pages.o: test_all_pages.c mock_driver.h
|
|
|
|
clean:
|
|
rm -f $(TARGET) $(TEST_ALL) *.o
|
|
|
|
run: $(TARGET)
|
|
./$(TARGET)
|
|
|
|
run-all: $(TEST_ALL)
|
|
./$(TEST_ALL)
|
|
|
|
# Enable verbose output
|
|
debug: CFLAGS += -DVERBOSE=1
|
|
debug: $(TARGET)
|
|
|
|
.PHONY: all clean run run-all debug
|