-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (28 loc) · 809 Bytes
/
Makefile
File metadata and controls
38 lines (28 loc) · 809 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
CC = gcc
CFLAGS = -g -O0 -w -Wall -Wextra -std=c11
CFLAGS2 = -g -w -Wall -Wextra -std=c11
LDFLAGS = -lm
TARGET_DIR = target/release
TARGET = $(TARGET_DIR)/spreadsheet
OBJ_DIR = obj
TEST_SRC = Tests.c
TEST_EXEC = test
SRC = 1.c display.c Functions.c Graph.c Parser.c
OBJ = $(patsubst %.c, $(OBJ_DIR)/%.o, $(SRC))
REPORT_SRC = report.tex
REPORT_PDF = report.pdf
all: $(TARGET)
$(TARGET): $(OBJ)
@mkdir -p $(TARGET_DIR)
$(CC) $(CFLAGS) -o $@ $(OBJ) $(LDFLAGS)
$(OBJ_DIR)/%.o: %.c
@mkdir -p $(OBJ_DIR)
$(CC) $(CFLAGS) -c $< -o $@
test:
$(CC) $(CFLAGS2) $(TEST_SRC) -o $(TEST_EXEC) $(LDFLAGS)
./$(TEST_EXEC)
report: $(REPORT_SRC)
pdflatex $(REPORT_SRC) && pdflatex $(REPORT_SRC)
clean:
rm -f $(OBJ) $(TARGET) $(REPORT_PDF) $(TEST_EXEC) *.aux *.log *.out $(TEST_OBJ)
.PHONY: all test report clean