-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (23 loc) · 711 Bytes
/
Makefile
File metadata and controls
31 lines (23 loc) · 711 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
# Makefile template for CS 270
# List of files
SRCS = Debug.c iFloat.c testFloat.c
OBJS = Debug.o iFloat.o testFloat.o
HEADERS = Debug.h iFloat.h convert.h
EXE = testFloat
DEFINES = -DDEBUG -DHALF
LIB = convert.a
# Compiler and loader commands and flags
GCC = gcc
GCC_FLAGS = -g -std=c11 -Wall -c
LD_FLAGS = -g -std=c11 -Wall
# Compile .c files to .o files
.c.o:
$(GCC) $(GCC_FLAGS) $(DEFINES) $<
# Target is the executable
default: $(OBJS) $(LIB)
$(GCC) -o $(EXE) $(LD_FLAGS) $(OBJS) $(LIB)
# Recompile C objects if headers change
${OBJS}: ${HEADERS}
# Clean up the directory
clean:
rm -f $(OBJS) *~ $(EXE)