-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
34 lines (26 loc) · 675 Bytes
/
makefile
File metadata and controls
34 lines (26 loc) · 675 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
CC = g++
SRCDIR = src
INCDIR = include
TESTDIR = tests
BINDIR = bin
LINKDIR = tests/linker
SOURCES = $(wildcard $(SRCDIR)/*.cpp)
MAIN_SOURCE = $(TESTDIR)/main.cpp
CFLAGS = -I$(INCDIR) -Wall -O3 -std=c++17
TARGET = $(BINDIR)/e++
TESTER = $(BINDIR)/tester
$(TARGET): $(SOURCES) $(MAIN_SOURCE)
@$(CC) $(CFLAGS) -o $@ $^
@echo "Compiler Built Successfully !!"
clean:
rm -f $(TARGET)
.PHONY: clean
Unix_OS := $(shell uname -s)
ifeq ($(Unix_OS),Darwin)
TESTER_LINKER := $(LINKDIR)/macos/tester_dep.o
else
TESTER_LINKER := $(LINKDIR)/linux/tester_dep.o
endif
tester: $(SOURCES) $(TESTER_LINKER)
@$(CC) $(CFLAGS) -w -o $(TESTER) $^
@echo "Tester Built Successfully !!"