-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (27 loc) · 698 Bytes
/
Makefile
File metadata and controls
35 lines (27 loc) · 698 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
# Name of the final executable
exec = kscript.out
# All C++ source files
sources = $(wildcard src/*.cpp)
# Corresponding object files
objects = $(sources:.cpp=.o)
# Compiler flags (debug info for now)
flags = -g
# C++ compiler
CXX = g++
# How to create the final executable
$(exec): $(objects)
$(CXX) $(objects) $(flags) -o $(exec)
# How to compile each .cpp file into a .o file
%.o: %.cpp include/%.h
$(CXX) -c $(flags) $< -o $@
install:
make
cp ./kscript.out /usr/local/bin/kscript
#now the kscript binary is available on your system globally
# now on just typing kscript in terminal you get the output as
#"Hello World!"
# Clean up everything
clean:
-rm *.out
-rm *.o
-rm src/*.o