-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
37 lines (27 loc) · 1003 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
#Flags for compiler
CC = gcc
CFLAGS = -Wall -std=c99 -pedantic -g
#Directories where compiler can find things
INCLUDE = -Iinclude
BINDIR = ./bin/
SRCDIR = ./src/
OBJDIR = ./obj/
PROGNAME = program
TESTHASH = testHash
all: assignment testHashTable
assignment: main.o dictFunc.o hashT.o fileIO.o
$(CC) $(OBJDIR)hashT.o $(OBJDIR)fileIO.o $(OBJDIR)dictFunc.o $(OBJDIR)main.o -o $(BINDIR)$(PROGNAME)
testHashTable: testHash.o hashT.o
$(CC) $(OBJDIR)hashT.o $(OBJDIR)testHash.o -o $(BINDIR)$(TESTHASH)
main.o:
$(CC) $(CFLAGS) $(INCLUDE) -c $(SRCDIR)main.c -o $(OBJDIR)main.o
dictFunc.o:
$(CC) $(CFLAGS) $(INCLUDE) -c $(SRCDIR)DictionaryFunctions.c -o $(OBJDIR)dictFunc.o
hashT.o:
$(CC) $(CFLAGS) $(INCLUDE) -c $(SRCDIR)HashTableAPI.c -o $(OBJDIR)hashT.o
testHash.o:
$(CC) $(CFLAGS) $(INCLUDE) -c $(SRCDIR)testHashTableAPI.c -o $(OBJDIR)testHash.o
fileIO.o:
$(CC) $(CFLAGS) $(INCLUDE) -c $(SRCDIR)FileIO.c -o $(OBJDIR)fileIO.o
clean:
rm $(OBJDIR)*.o $(BINDIR)$(PROGNAME) $(BINDIR)$(TESTHASH)