-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (40 loc) · 1.64 KB
/
Makefile
File metadata and controls
54 lines (40 loc) · 1.64 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
49
50
51
52
53
54
CC=gcc
CDSDIR=./cds/
TESTSDIR=./tests/
CFLAGS= -Wall -g -I$(CDSDIR) -I$(TESTSDIR)
ARRAYLIST=$(addprefix $(CDSDIR), ArrayList.h ArrayList.c)
BIGINTEGER=$(addprefix $(CDSDIR), BigInteger.h BigInteger.c)
BINARYHEAP=$(addprefix $(CDSDIR), BinaryHeap.h BinaryHeap.c heap_sort.c)
BINARYTREE=$(addprefix $(CDSDIR), BinaryTree.h BinaryTree.c)
LINKEDLIST=$(addprefix $(CDSDIR), LinkedList.h LinkedList.c)
MATRIX=$(addprefix $(CDSDIR), Matrix.h Matrix.c)
IALLOC=$(addprefix $(TESTSDIR), ialloc.h ialloc.c)
OBJECTS=ArrayList.o BinaryHeap.o LinkedList.o Matrix.o ialloc.o heap_sort.o BinaryTree.o BigInteger.o
.PHONY: all library
all: apsp dfs sort tree
library: $(OBJECTS)
ar -rcs libcds.a $(OBJECTS)
apsp: $(OBJECTS) $(TESTSDIR)apsp.c
$(CC) $(CFLAGS) $(OBJECTS) $(TESTSDIR)apsp.c -o $@
bigints: $(OBJECTS) $(TESTSDIR)bigints.c
$(CC) $(CFLAGS) $(OBJECTS) $(TESTSDIR)bigints.c -o $@
dfs: $(OBJECTS) $(TESTSDIR)dfs.c
$(CC) $(CFLAGS) $(OBJECTS) $(TESTSDIR)dfs.c -o $@
sort: $(OBJECTS) $(TESTSDIR)sort.c
$(CC) $(CFLAGS) $(OBJECTS) $(TESTSDIR)sort.c -o $@
tree: $(OBJECTS) $(TESTSDIR)tree.c
$(CC) $(CFLAGS) $(OBJECTS) $(TESTSDIR)tree.c -o $@
ialloc.o: $(IALLOC)
$(CC) $(CFLAGS) $(TESTSDIR)ialloc.c -c -o $@
Matrix.o: $(MATRIX)
$(CC) $(CFLAGS) $(CDSDIR)Matrix.c -c -o $@
LinkedList.o: $(LINKEDLIST)
$(CC) $(CFLAGS) $(CDSDIR)LinkedList.c -c -o $@
BinaryTree.o: $(BINARYTREE)
$(CC) $(CFLAGS) $(CDSDIR)BinaryTree.c -c -o $@
BinaryHeap.o heap_sort.o: $(BINARYHEAP)
$(CC) $(CFLAGS) $(CDSDIR)BinaryHeap.c $(CDSDIR)heap_sort.c -c
BigInteger.o: $(BIGINTEGER)
$(CC) $(CFLAGS) $(CDSDIR)BigInteger.c -c -o $@
ArrayList.o: $(ARRAYLIST)
$(CC) $(CFLAGS) $(CDSDIR)ArrayList.c -c -o $@