-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
66 lines (55 loc) · 2.22 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
CC=g++
FLAGS=-std=c++11 -ggdb
# Useless
FLAGS_EXTENDED=-fpermissive -Wformat-security
all: clean test_compile test
run: run_compile
cd binary/ &&clear && clear
install: clean run_compile
@echo "====================================================================================================="
@echo "Preparing to install MakeMaker under your system..."
@echo "Maybe you'll be asked for your 'sudo' password, please provide in order to finish the installation."
@echo "====================================================================================================="
sudo cp binary/mm /usr/bin/mm
clear
clear
clear
@echo "=========================================================================="
@echo "Done! Just type 'mm' and watch the magic happen!"
@echo "=========================================================================="
uninstall: clean
@echo "Preparing to remove MakeMaker from your system."
@echo "Maybe you'll be asked for your 'sudo' password, please provide in order to finish the removal"
sudo rm -f /usr/bin/mm
clear
clear
clear
@echo "=========================================================================="
@echo "Done! Very sad to see you go :/"
@echo "=========================================================================="
test:
cd binary/ && clear && clear && ./Test compiler g++ main.c -o main
test_compile:
$(CC) src/tests/Test.cpp -o binary/Test $(FLAGS)
run_compile:
mkdir binary
$(CC) src/Run.cpp -o binary/mm $(FLAGS)
@echo "Compile finished!"
compile:
$(CC) src/Command.hpp -o binary/Command.o $(FLAGS)
$(CC) src/CommandInterpreter.hpp -o binary/CommandInterpreter.o $(FLAGS)
$(CC) src/Compiler.hpp -o binary/Compiler.o $(FLAGS)
$(CC) src/File.hpp -o binary/File.o $(FLAGS)
$(CC) src/FileManager.hpp -o binary/FileManager.o $(FLAGS)
$(CC) src/FileInterpreter.hpp -o binary/FileInterpreter.o $(FLAGS)
$(CC) src/Flag.hpp -o binary/Flag.o $(FLAGS)
$(CC) src/MakeFile.hpp -o binary/MakeFile.o $(FLAGS)
$(CC) src/Target.hpp -o binary/Target.o $(FLAGS)
$(CC) src/tests/Test.cpp -o binary/Test.o $(FLAGS)
$(CC) src/Run.cpp -o binary/Run.o $(FLAGS)
debug: clean
$(CC) src/tests/Test.cpp -o binary/Test $(FLAGS) -g
clean:
rm -f binary/*
mkdir -p binary
@echo "Cleaning done!"