-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
122 lines (95 loc) · 2.23 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# MIT License
#
# Copyright (c) 2020-2021 Ferhat Geçdoğan All Rights Reserved.
# Distributed under the terms of the MIT License.
#
#
SOURCE = ./src/
INSTALLATION = /bin/
OUTPUT = scrift
# Apps
SRCAPPSDIREC = ./Apps/
# Libraries
SRCLIBDIREC = ./library/
# Scrift's Syntax
SRCSYNTAXDIREC = $(SOURCE)Syntax/
INCLUDELIB = $(SRCLIBDIREC)
INCLUDEDIR = ./include/
# Include flags etc.
CPPFLAGS = -lstdc++fs -I$(INCLUDELIB) -I$(INCLUDEDIR)
GCC = cc
CPP = c++
STANDARD = -std=c++2a
COMPILER = $(CPP) $(STANDARD)
COMP = $(GCC)
# Clean all
CLEANALL = $(OUTPUT)
# Clean object files
CLEAN = *.o
# Scrift's Syntax objects
HEADERFILE = CommandFunc.o \
GetNameFunction.o \
FileFunction.o \
RunFunction.o \
Log.o \
History.o \
Branch.o \
Template.o \
Settings.o \
HelpFunction.o \
ASCIIFunction.o \
Setup.o \
Tools.o \
Locale.o \
Alias.o \
Validation.o \
# Platform
ifeq ($(OS), Windows_NT)
echo Windows_NT is not supported!
else
CLEAN := rm -f $(CLEAN)
CLEANALL := rm -f $(CLEANALL)
endif
# Build
all: fpm headersfile main clean
# Build & Install
install: fpmc headersfile mainc clean
# Remove & Clean all
removeall: uninstall cleanall
# Build & Run
runall: all run
libraries:
bash init/get_libraries.sh
# Get Fpm (Fegeya Package Manager)
fpm: libraries
sh init/get_fpm.sh
# Install Fpm (Fegeya Package Manager)
fpmc: fpm
sh init/install_fpm.sh
# Scrift's Core.
headersfile: $(HEADERFILE)
# Syntax
%.o: $(SRCSYNTAXDIREC)%.cpp
$(COMPILER) $(CPPFLAGS) -c $< -o $@
echo $@
# Main Build
main: $(SOURCE)Scrift.cpp
$(COMPILER) $(CPPFLAGS) $< $(HEADERFILE) -o $(OUTPUT)
echo Scrift.cpp
# Main Build & Install
mainc: $(SOURCE)Scrift.cpp
$(COMPILER) $(CPPFLAGS) $< $(HEADERFILE) -o $(INSTALLATION)$(OUTPUT)
echo Scrift [Install]
# Remove Scrift.
uninstall:
rm -f $(INSTALLATION)$(OUTPUT)
# Run Scrift
run:
./$(OUTPUT)
# Clean object files
clean:
$(CLEAN)
# Clean object files and Scrift.
cleanall:
echo Clean
$(CLEANALL)