-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (31 loc) · 819 Bytes
/
Makefile
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
######################################################################
#
# Author: Hannah Pan
# Date: 01/31/2021
#
# The autograder will run the following command to build the program:
#
# make -B
#
######################################################################
# name of the program to build
#
PROG=main
PROMPT='"$(PROG)> "'
# Remove -DNDEBUG during development if assert(3) is used
#
override CPPFLAGS += -DNDEBUG -DPROMPT=$(PROMPT)
CC = clang
# Replace -O1 with -g for a debug version during development
#
CFLAGS = -Wall -g
SRCS = $(wildcard *.c)
OBJS = $(SRCS:.c=.o)
HEADERS = $(wildcard *.h)
.PHONY : clean
$(PROG) : $(OBJS) $(HEADERS)
$(CC) -o $@ $(OBJS)
%.o: %.c $(HEADERS)
$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
clean :
$(RM) $(OBJS) $(PROG)