-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
31 lines (24 loc) · 820 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
# Set the compiler and compiler flags
CC = gcc
# -g adds debugging information to the executable file while -Wall enables all the warnings
CFLAGS = -g -Wall
# The build target executable:
all: test
# To create the executable file
test: test_assign1_1.o storage_mgr.o dberror.o
$(CC) $(CFLAGS) -o test_assign1 test_assign1_1.o storage_mgr.o dberror.o -lm
# To create the object file
test_assign1_1.o: test_assign1_1.c dberror.h storage_mgr.h test_helper.h
$(CC) $(CFLAGS) -c test_assign1_1.c -lm
# To create the object file
storage_mgr.o: storage_mgr.c storage_mgr.h
$(CC) $(CFLAGS) -c storage_mgr.c -lm
# To create the object file
dberror.o: dberror.c dberror.h
$(CC) $(CFLAGS) -c dberror.c
# To remove generated files
clean:
$(RM) test *.o *~ test_assign1 *.bin
# Run the test
run_test:
./test_assign1