summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOxore <oxore@protonmail.com>2017-05-25 18:41:18 +0700
committerOxore <oxore@protonmail.com>2017-05-25 18:41:18 +0700
commitd66b6169cf254cd0d7c83354170824c39a663ad5 (patch)
treee7559a88fb35c15f0e83de78b41cd3a8bba4a93e
parent5a8b79c468578cd5226d8a543324835ca6978103 (diff)
Makefile added, README.md updated
-rw-r--r--Makefile18
-rw-r--r--README.md10
-rwxr-xr-xbld1
-rw-r--r--src/functions.c2
4 files changed, 23 insertions, 8 deletions
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);
}