чување 7c5debb5d2944784b1b132e10349f2c3d3d8b865
родитељ 0502121869eba07ebc875f79f9588945a3c58012
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Tue, 15 Aug 2023 15:06:55 +0200
INSTALL,install.do,uninstall.do: New files
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 6, додавања: 66(+), брисања: 7(-)
diff --git a/INSTALL b/INSTALL
@@ -0,0 +1,30 @@
+Prerequisites
+=============
+
+* C compiler (GCC-compatible) - ${CC:-gcc -g}
+* gzip
+
+
+Install
+-------
+
+ $ git clone https://git.sr.ht/~strahinja/lav-sdl
+ $ cd lav-sdl
+ $ su
+
+If you have djb redo:
+
+ # redo install
+
+if you don't:
+
+ # ./do install
+
+
+Persistent build configuration file
+-----------------------------------
+
+If a file config.redo exists in the build directory, it will be sourced when
+building targets which also accept configuration through environment variables.
+For example, CC and PREFIX can be specified in config.redo, eliminating
+the need to pass them with each build.
diff --git a/README b/README
@@ -4,6 +4,12 @@ Lavirint
SDL maze solver
+Install
+-------
+
+See the file INSTALL in this repository.
+
+
Usage
-----
@@ -13,10 +19,13 @@ $ ./lav-sdl labyrinth_file.dat
Format of data file
-------------------
-<x coordinate of starting cell> <y coordinate of starting cell>
-<x coordinate of ending cell> <y coordinate of ending cell>
-<Rows of 1 and 0, 1 = wall, 0 = empty space; spaces are ignored>
+ASCII:
+
+<starting_cell.x> <starting_cell.y>
+<ending_cell.x> <ending_cell.y>
+<Rows of digits 1 and 0, 1 = wall, 0 = empty space; spaces are ignored>
+All coordinates are 1-based.
License
-------
diff --git a/default.o.do b/default.o.do
@@ -1,4 +1,7 @@
redo-ifchange $2.c
-CFLAGS=${CFLAGS:- -Wall}
+if [ -r ./config.redo ]; then
+ . ./config.redo
+fi
+CC=${CC:-gcc -g}
INCLUDES=$(pkg-config --cflags sdl2)
-gcc $CFLAGS $INCLUDES -o $3 -c $2.c
+$CC -Wall -std=c99 $INCLUDES -o $3 -c $2.c
diff --git a/install.do b/install.do
@@ -0,0 +1,8 @@
+redo-ifchange all
+if [ -r ./config.redo ]; then
+ . ./config.redo
+fi
+PREFIX=${PREFIX:-/usr/local}
+BINDIR=$PREFIX/bin
+install -d $BINDIR
+install -m 0755 lav-sdl $BINDIR
diff --git a/lav-sdl.do b/lav-sdl.do
@@ -1,6 +1,9 @@
redo-ifchange lav-sdl.o
-CFLAGS=${CFLAGS:- -Wall}
+if [ -r ./config.redo ]; then
+ . ./config.redo
+fi
+CC=${CC:-gcc -g}
LIBS=$(pkg-config --libs sdl2)
LIBS="$LIBS $(pkg-config --libs SDL2_image)"
LIBS="$LIBS -lm"
-gcc $CFLAGS -o $3 lav-sdl.o $LIBS
+$CC -Wall -std=c99 -o $3 lav-sdl.o $LIBS
diff --git a/uninstall.do b/uninstall.do
@@ -0,0 +1,6 @@
+if [ -r ./config.redo ]; then
+ . ./config.redo
+fi
+PREFIX=${PREFIX:-/usr/local}
+BINDIR=$PREFIX/bin
+rm -f $BINDIR/lav-sdl