-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (38 loc) · 727 Bytes
/
Copy pathMakefile
File metadata and controls
46 lines (38 loc) · 727 Bytes
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
#
# Makefile
# My Engine
#
# Created by Nikhil Arora on 9/22/2021.
# Copyright © 2021 Nikhil Arora. All rights reserved.
#
# Makefile used to build project
CC = g++
CFLAGS = -Wall -O2
EXE = engine
TESTEXE = test
BIN = bin
SRC = src
DFLAGS = -DDEBUG
# all
all:
build
# build the executable
build:
mkdir -p $(BIN)
$(CC) $(CFLAGS) -o $(BIN)/$(EXE) $(SRC)/*.cpp
# run the executable
run: build
./$(BIN)/$(EXE)
# clean up files
clean:
rm -f $(BIN)/$(EXE)
rm -f $(BIN)/$(TESTEXE)
# build unit tests
buildtest:
mkdir -p $(BIN)
$(CC) $(CFLAGS) $(DFLAGS) -o $(BIN)/$(TESTEXE) $(SRC)/*.cpp
# run unit tests
test: buildtest
./$(BIN)/$(TESTEXE)
# run sanity check
check: