-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (30 loc) · 973 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
38
39
40
41
# Author: Andre D'Souza
# Variables of all object files
BIN = ./bin/
LIB = ./lib/
SRC = ./src/
# Override Default Variables
CC = gcc # Compiler
CFLAGS = -c -g -Wall -Wpedantic --std=gnu99 -Iinclude # C Compiler Flags
# Defualt Rule
all: myShell.o funcSet1.o funcSet2.o funcSet3.o testfile.o
$(CC) $(BIN)myShell.o $(BIN)funcSet1.o $(BIN)funcSet2.o $(BIN)funcSet3.o -o $(BIN)myShell
$(CC) $(BIN)testfile.o -o $(BIN)testfile
myShell.o:
$(CC) $(CFLAGS) -c $(SRC)myShell.c -o $(BIN)myShell.o
funcSet1.o:
$(CC) $(CFLAGS) -c $(SRC)funcSet1.c -o $(BIN)funcSet1.o
funcSet2.o:
$(CC) $(CFLAGS) -c $(SRC)funcSet2.c -o $(BIN)funcSet2.o
funcSet3.o:
$(CC) $(CFLAGS) -c $(SRC)funcSet3.c -o $(BIN)funcSet3.o
testfile.o:
$(CC) $(CFLAGS) -c $(SRC)testfile.c -o $(BIN)testfile.o
# Cleaning Up All Artifacts
.PHONY: clean
clean:
rm -f -r $(BIN)*
run:
$(BIN)myShell
valgrind:
valgrind --leak-check=yes $(BIN)myShell