-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (35 loc) · 1.24 KB
/
Copy pathMakefile
File metadata and controls
48 lines (35 loc) · 1.24 KB
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
47
48
# Authored by Christopher Tam for Georgia Tech's CS 2200
#Edited by Tanner Muldoon
TARGET = os-sim
CC = gcc
CFLAGS = -Wall -Wextra -Wsign-conversion -Wpointer-arith -Wcast-qual -Wwrite-strings -Wshadow -Wmissing-prototypes -Wpedantic -Wwrite-strings -g -std=gnu99 -lm -march=armv8-a
LFLAGS = -lpthread
SRCDIR = src
SRCFILE = $(SRCDIR)/student.c
INCDIR = $(SRCDIR)
BINDIR = .
SUBMIT_FILES = $(SRCFILE) Makefile answers.txt
SUBMISSION_NAME = project4-scheduling
SRC := $(wildcard $(SRCDIR)/*.c)
INC := $(wildcard $(INCDIR)/*.h)
INCFLAGS := $(patsubst %/,-I%,$(dir $(wildcard $(INCDIR)/.)))
.PHONY: all
all:
@$(MAKE) release && \
echo "$$(tput setaf 3)$$(tput bold)Note:$$(tput sgr0) this project compiled with release flags by default. To compile for debugging, please use $$(tput setaf 6)$$(tput bold)make debug$$(tput sgr0)."
.PHONY: debug
debug: CFLAGS += -ggdb -g3 -DDEBUG
debug: $(BINDIR)/$(TARGET)
.PHONY: tsan-debug
tsan-debug: CFLAGS += -fsanitize=thread
tsan-debug: debug
.PHONY: release
release: CFLAGS += -mtune=native -O2
release: $(BINDIR)/$(TARGET)
.PHONY: clean
clean:
@rm -f $(BINDIR)/$(TARGET)
@rm -rf $(BINDIR)/$(TARGET).dSYM
$(BINDIR)/$(TARGET): $(SRC) $(INC)
@mkdir -p $(BINDIR)
@$(CC) $(CFLAGS) $(INCFLAGS) $(SRC) -o $@ $(LFLAGS)