From d66b6169cf254cd0d7c83354170824c39a663ad5 Mon Sep 17 00:00:00 2001 From: Oxore Date: Thu, 25 May 2017 18:41:18 +0700 Subject: Makefile added, README.md updated --- Makefile | 18 ++++++++++++++++++ README.md | 10 ++++------ bld | 1 - src/functions.c | 2 +- 4 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 Makefile delete mode 100755 bld diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b274ebc --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +CC=gcc +FILES:=$(wildcard src/*.c) +FILES:=$(FILES:.c=.o) + +CFLAGS += -Wall +CFLAGS += -std=c99 +CFLAGS += -O3 +LIBS += -lcsfml-graphics +LIBS += -lcsfml-window +LIBS += -lcsfml-system + +all: tetris + +tetris: $(FILES) + $(CC) -o $@ $^ $(CFLAGS) $(LIBS) + +clean: + rm -f tetris $(FILES) diff --git a/README.md b/README.md index 7afde7c..44e66b2 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,12 @@ ## Tetris CSFML -This is unfinished tetris project written in pure C with CSFML-2.3-2 library. It is under development. Obvious, it depends on csfml. +This is unfinished tetris project written in pure C with CSFML library. It is under development. Obvious, it depends on csfml, but nothing more. -To compile and run the source code under __nix__ just enter following commands: +__Compilation__ ``` -./bld -./main +make all ``` -Hit *Return* to start game. +File named "tetris" is the final binary. Run it. Hit *Return* to start game. __TODO:__ @@ -16,4 +15,3 @@ __TODO:__ - Three next shapes - Main menu with beauties - Look with sprites -- Autotools script diff --git a/bld b/bld deleted file mode 100755 index 693dcd9..0000000 --- a/bld +++ /dev/null @@ -1 +0,0 @@ -gcc -O3 src/main.c src/functions.c src/shape_maps.c -o main -lcsfml-graphics -lcsfml-window -lcsfml-system diff --git a/src/functions.c b/src/functions.c index 499a085..603cc5f 100644 --- a/src/functions.c +++ b/src/functions.c @@ -135,7 +135,7 @@ void scoreDisplay() { for (int i=0;i<7;i++) { a[i] = b[i]; } - scoreDisp = &a; + scoreDisp = (char *)&a; sfText_setString(textScore, scoreDisp); } -- cgit v1.2.3