-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (32 loc) · 951 Bytes
/
Makefile
File metadata and controls
46 lines (32 loc) · 951 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
CC = cc
TARGET = target
FLAGS = -D_GNU_SOURCE
IMFS_BIN = $(TARGET)/imfs
IMFS_OBJ = $(TARGET)/imfs.o
TEST_BIN = $(TARGET)/tests/fstest
IMFS_SRC = imfs.c
TEST_SRC = tests.c
PJD_SRC = ./pjdfstest/pjdfstest.c
PJD_BIN = $(TARGET)/fstest
PJD_FST = ./pjdfstest/fstest.c
FST_BIN = ./pjdfstest/tests/fstestrun
TESTRUNNER = ./testrunner.py
$(TARGET):
mkdir -p $(TARGET)
imfs: $(TARGET) $(IMFS_SRC)
$(CC) $(FLAGS) $(IMFS_SRC) -o $(IMFS_BIN)
debug: $(TARGET) $(IMFS_SRC)
$(CC) $(FLAGS) $(IMFS_SRC) -g -o $(IMFS_BIN)
lib: $(TARGET) $(IMFS_SRC)
$(CC) $(FLAGS) $(CFLAGS) -DLIB -c $(IMFS_SRC) -o $(IMFS_OBJ)
test: $(TARGET) $(PJD_SRC) $(PJD_FST) $(IMFS_SRC)
$(CC) -DLIB $(IMFS_SRC) $(PJD_SRC) -o $(PJD_BIN)
$(CC) $(PJD_FST) -o $(FST_BIN)
test-%: $(TARGET) $(PJD_SRC) $(PJD_FST) $(IMFS_SRC)
$(CC) -DLIB $(IMFS_SRC) $(PJD_SRC) -o $(PJD_BIN)
$(CC) $(PJD_FST) -o $(FST_BIN)
@$(TESTRUNNER) "$*"
test: tests
imfs: imfs
clean:
rm -rf $(TARGET)