first commit
This commit is contained in:
commit
c479b42b33
9 changed files with 27 additions and 0 deletions
23
Makefile
Normal file
23
Makefile
Normal file
|
@ -0,0 +1,23 @@
|
|||
CC = gcc
|
||||
CFLAGS = -Wall -Wextra -pedantic-errors -std=c99 -Wno-format -lncurses
|
||||
OUTFILE = nsnake
|
||||
|
||||
SRCDIR = src
|
||||
OBJDIR = obj
|
||||
INCDIR = src/include
|
||||
|
||||
SRC = $(wildcard $(SRCDIR)/*.c)
|
||||
INC = $(wildcard $(INCDIR)/*.h)
|
||||
_OBJ = $(SRC:.c=.o)
|
||||
OBJ = $(subst $(SRCDIR),$(OBJDIR),$(_OBJ))
|
||||
|
||||
$(OUTFILE): $(OBJ)
|
||||
$(CC) $(CFLAGS) -o $(OUTFILE) $(OBJ)
|
||||
|
||||
$(OBJDIR)/%.o: $(SRCDIR)/%.c $(INCDIR)/%.h
|
||||
@mkdir -p $(@D)
|
||||
$(CC) $(CFLAGS) -o $@ -c $<
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-rm $(OUTFILE) $(OBJ)
|
0
src/apple.c
Normal file
0
src/apple.c
Normal file
0
src/include/apple.h
Normal file
0
src/include/apple.h
Normal file
0
src/include/main.h
Normal file
0
src/include/main.h
Normal file
0
src/include/segment.h
Normal file
0
src/include/segment.h
Normal file
0
src/include/snake.h
Normal file
0
src/include/snake.h
Normal file
4
src/main.c
Normal file
4
src/main.c
Normal file
|
@ -0,0 +1,4 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "include/main.h"
|
0
src/segment.c
Normal file
0
src/segment.c
Normal file
0
src/snake.c
Normal file
0
src/snake.c
Normal file
Loading…
Reference in a new issue