add makefile and main fn
This commit is contained in:
commit
e0e9557e71
3 changed files with 30 additions and 0 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
*.o
|
||||||
|
|
||||||
|
othello
|
26
Makefile
Normal file
26
Makefile
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
CXX = gcc
|
||||||
|
CXXFLAGS = -std=c99 -pedantic
|
||||||
|
RM = rm
|
||||||
|
|
||||||
|
SOURCES = $(wildcard src/*.c)
|
||||||
|
OBJETS = $(patsubst %.c,%.c.o,$(notdir $(SOURCES)))
|
||||||
|
|
||||||
|
EXE = othello
|
||||||
|
|
||||||
|
%.c.o: src/%.c
|
||||||
|
$(CXX) -c -o $@ $< $(CXXFLAGS) $(DEVFLAGS)
|
||||||
|
|
||||||
|
main: CXXFLAGS += -O3
|
||||||
|
main: compilation
|
||||||
|
|
||||||
|
dev: CXXFLAGS += -Wall -Wextra -Wshadow -Wcast-align -Wstrict-prototypes -fanalyzer -fsanitize=undefined -g
|
||||||
|
dev: compilation
|
||||||
|
|
||||||
|
compilation: $(OBJETS)
|
||||||
|
$(CXX) -o $(EXE) $(OBJETS)
|
||||||
|
|
||||||
|
all:
|
||||||
|
main
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(RM) $(OBJETS) $(EXE)
|
1
src/main.c
Normal file
1
src/main.c
Normal file
|
@ -0,0 +1 @@
|
||||||
|
int main(void) {}
|
Reference in a new issue