Add Makefile & .gitignore
This commit is contained in:
parent
bb5a2642e3
commit
ba9d670ebd
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*.o
|
||||
build/*
|
26
Makefile
Normal file
26
Makefile
Normal file
@ -0,0 +1,26 @@
|
||||
BUILDDIR := ./build
|
||||
SRCDIR := ./src
|
||||
CXX := g++
|
||||
|
||||
# Linker flag
|
||||
LD_CXXFLAGS =
|
||||
|
||||
# Compilation flag
|
||||
CXXFLAGS = -Wall -Wextra -std=gnu99 -g -O3
|
||||
# Remove warnings about unused variables, functions, ...
|
||||
# -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable
|
||||
# Compile with debug
|
||||
# -g
|
||||
# See memory leaks and Incorrect Read/Write
|
||||
# -fsanitize=address -lasan
|
||||
|
||||
$(BUILDDIR)/main: $(SRCDIR)/main.cpp
|
||||
$(CXX) $^ -o $@ $(CFLAGS) $(LD_CFLAGS)
|
||||
|
||||
|
||||
$(BUILDDIR)/%.o: $(SRCDIR)/%.cpp $(SRCDIR)/include/%.h
|
||||
$(CXX) -c $< -o $@ $(CFLAGS)
|
||||
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILDDIR)/*
|
0
build/.gitkeep
Normal file
0
build/.gitkeep
Normal file
Loading…
Reference in New Issue
Block a user