-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
76 lines (57 loc) · 2.43 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
###
#
# For more information about makefiles, check here:
# http://www.gnu.org/software/make/manual/make.html
#
# Original makefile by Shane Culpepper, modified by Jeffrey Chan, 2015
###
# The name of the applications we're trying to generate. Do not change these.
TARGET_AL_AL = bpGraphAL_AL
TARGET_AL_LL = bpGraphAL_LL
TARGET_AL_BL = bpGraphAL_BL
TARGET_AM = bpGraphAdjMat
SRC_AL_AL = main.c memoryUtil.c linkedList.c bpGraphAdjList_AL.c
SRC_AL_LL = main.c memoryUtil.c linkedList.c bpGraphAdjList_LL.c
SRC_AL_BL = main.c memoryUtil.c linkedList.c binaryTree.c bpGraphAdjList_BL.c
#SRC_AL_BT = testMain.c memoryUtil.c linkedList.c binaryTree.c bpGraphAdjList_BT.c
SRC_AM = main.c memoryUtil.c linkedList.c bpGraphAdjMat_AA.c
HDR = memoryUtil.h linkedList.h binaryTree.h bipartiteGraph.h commonDefs.h
OBJ_AL_AL := $(SRC_AL_AL:.c=.o)
OBJ_AL_LL := $(SRC_AL_LL:.c=.o)
OBJ_AL_BL := $(SRC_AL_BL:.c=.o)
OBJ_AM := $(SRC_AM:.c=.o)
# These variables are used by make in all of it's automatic rules.
# Specifically, use CFLAGS for the "-g -O0" option if you want to do debugging,
# and LDFLAGS for the "-lm" option if you are using the math library.
CC = gcc
#CFLAGS = -W -Wall -ansi -O3 -D_XOPEN_SOURCE=500
CFLAGS = -W -Wall -ansi -g -O0 -D_XOPEN_SOURCE=500
LDFLAGS = -lm
all : $(TARGET_AL_AL)
$(TARGET_AL_AL) : $(OBJ_AL_AL)
$(CC) $(LDFLAGS) -o $@ $(OBJ_AL_AL)
$(TARGET_AL_LL) : $(OBJ_AL_LL)
$(CC) $(LDFLAGS) -o $@ $(OBJ_AL_LL)
$(TARGET_AL_BL) : $(OBJ_AL_BL)
$(CC) $(LDFLAGS) -o $@ $(OBJ_AL_BL)
$(TARGET_AM) : $(OBJ_AM)
$(CC) $(LDFLAGS) -o $@ $(OBJ_AM)
# This generates the dependencies between your various .c and .h files, using
# the c compiler's -MM option.
depend : $(SRC_AL_AL) $(SRC_AL_LL) $(SRC_AM) $(SRC_EL) $(HDR)
$(CC) $(CFLAGS) -MM $(SRC_AL_AL) > depend
$(CC) $(CFLAGS) -MM $(SRC_AL_LL) > depend
$(CC) $(CFLAGS) -MM $(SRC_AL_BL) > depend
$(CC) $(CFLAGS) -MM $(SRC_AM) > depend
# This includes the dependencies made with the previous rule, and in fact forces
# them to be generated.
-include depend
# The rules below clean up any files generated by the make process. clean
# should be run to clear out the temporary files, and clobber should be run if
# you modify your makefile (for example to change the CFLAGS or LDFLAGS options)
# so that you can get a clean recompile.
.PHONY : clean
clean :
-rm -f depend
-rm -f $(TARGET_AL_AL) $(TARGET_AL_LL) $(TARGET_AL_BL) $(TARGET_AM) $(OBJ_AL_AL) $(OBJ_AL_LL) $(OBJ_AL_BL) $(OBJ_AM)
-rm -f *~