fix Makefile and README.md for 2019/duble
This commit is contained in:
1 parent
fe10437f5c
commit
a9e40a9182
3 files changed
+121
-39
No files matched your search
@@ -1,3 +1,8 @@
|
|||||||
Darwin
|
Darwin
|
||||||
|
Darwin.alt
|
||||||
|
FreeBSD
|
||||||
|
FreeBSD.alt
|
||||||
|
Linux
|
||||||
|
Linux.alt
|
||||||
prog
|
prog
|
||||||
prog.alt
|
prog.alt
|
||||||
+88
-15
@@ -65,14 +65,15 @@ X11_INCDIR= /opt/X11/include
|
|||||||
#CSILENCE=
|
#CSILENCE=
|
||||||
CSILENCE= -Wno-bitwise-op-parentheses -Wno-dangling-else -Wno-format-security \
|
CSILENCE= -Wno-bitwise-op-parentheses -Wno-dangling-else -Wno-format-security \
|
||||||
-Wno-implicit-int -Wno-incompatible-pointer-types \
|
-Wno-implicit-int -Wno-incompatible-pointer-types \
|
||||||
-Wno-logical-op-parentheses -Wno-unused-value
|
-Wno-logical-op-parentheses -Wno-pedantic -Wno-return-type \
|
||||||
|
-Wno-unused-value
|
||||||
|
|
||||||
# Common C compiler warning flags
|
# Common C compiler warning flags
|
||||||
#
|
#
|
||||||
#CWARN= ${CSILENCE}
|
#CWARN= ${CSILENCE}
|
||||||
#CWARN= -Wall ${CSILENCE}
|
#CWARN= -Wall ${CSILENCE}
|
||||||
CWARN= -Wall -Wextra ${CSILENCE}
|
#CWARN= -Wall -Wextra ${CSILENCE}
|
||||||
#CWARN= -Wall -Wextra -pedantic ${CSILENCE}
|
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
|
||||||
|
|
||||||
# Compiler standard
|
# Compiler standard
|
||||||
#
|
#
|
||||||
@@ -94,7 +95,7 @@ ARCH=
|
|||||||
|
|
||||||
# Defines that are needed to compile
|
# Defines that are needed to compile
|
||||||
#
|
#
|
||||||
CDEFINE= -Dg=11 -Ds=0 -DV=24 -DW=80
|
CDEFINE=
|
||||||
#CDEFINE= -DIOCCC
|
#CDEFINE= -DIOCCC
|
||||||
|
|
||||||
# Include files that are needed to compile
|
# Include files that are needed to compile
|
||||||
@@ -103,8 +104,8 @@ CINCLUDE=
|
|||||||
#CINCLUDE= -include stdlib.h
|
#CINCLUDE= -include stdlib.h
|
||||||
#CINCLUDE= -include stdio.h
|
#CINCLUDE= -include stdio.h
|
||||||
#CINCLUDE= -include stdlib.h -include stdio.h
|
#CINCLUDE= -include stdlib.h -include stdio.h
|
||||||
#CINCLUDE= -I ${X11_INCDIR}
|
#CINCLUDE= -I ${X11_INCDIR} -I ${X11_INCDIR}/X11
|
||||||
#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
|
#CINCLUDE= `${SDL2_CONFIG} --cflags`
|
||||||
|
|
||||||
# Optimization
|
# Optimization
|
||||||
#
|
#
|
||||||
@@ -128,7 +129,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
|||||||
LIBS=
|
LIBS=
|
||||||
#LIBS= -lm
|
#LIBS= -lm
|
||||||
#LIBS= -L ${X11_LIBDIR} -lX11
|
#LIBS= -L ${X11_LIBDIR} -lX11
|
||||||
#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL
|
#LIBS= `${SDL2_CONFIG} --libs`
|
||||||
|
|
||||||
# C compiler to use
|
# C compiler to use
|
||||||
#
|
#
|
||||||
@@ -140,10 +141,7 @@ CC= cc
|
|||||||
#
|
#
|
||||||
ifeq ($(CC),clang)
|
ifeq ($(CC),clang)
|
||||||
#
|
#
|
||||||
CSILENCE+= -Wno-comma -Wno-implicit-int-conversion -Wno-missing-prototypes \
|
#CSILENCE+=
|
||||||
-Wno-missing-variable-declarations -Wno-pedantic \
|
|
||||||
-Wno-poison-system-directories -Wno-shadow -Wno-shorten-64-to-32 \
|
|
||||||
-Wno-strict-prototypes -Wno-zero-length-array
|
|
||||||
#
|
#
|
||||||
CWARN+= -Weverything
|
CWARN+= -Weverything
|
||||||
#
|
#
|
||||||
@@ -168,12 +166,18 @@ ENTRY= duble
|
|||||||
PROG= prog
|
PROG= prog
|
||||||
#
|
#
|
||||||
OBJ= ${PROG}.o
|
OBJ= ${PROG}.o
|
||||||
|
CSRC= ${PROG}.o
|
||||||
DATA=
|
DATA=
|
||||||
TARGET= ${PROG}
|
TARGET= ${PROG}
|
||||||
#
|
#
|
||||||
ALT_OBJ= ${PROG}.alt.o
|
ALT_OBJ= ${PROG}.alt.o
|
||||||
ALT_TARGET= ${PROG}.alt
|
ALT_TARGET= ${PROG}.alt
|
||||||
|
|
||||||
|
LINES= 24
|
||||||
|
COLUMNS= 80
|
||||||
|
|
||||||
|
OS_SET= Linux FreeBSD Darwin
|
||||||
|
|
||||||
|
|
||||||
#################
|
#################
|
||||||
# build the entry
|
# build the entry
|
||||||
@@ -186,17 +190,85 @@ all: data ${TARGET}
|
|||||||
love haste waste maker easter_egg sandwich \
|
love haste waste maker easter_egg sandwich \
|
||||||
supernova deep_magic magic charon pluto
|
supernova deep_magic magic charon pluto
|
||||||
|
|
||||||
${PROG}: ${PROG}.c
|
${PROG}:
|
||||||
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
${MAKE} `${UNAME}`
|
||||||
|
|
||||||
${PROG}.alt: ${PROG}.alt.c
|
check-os: check-os.sh
|
||||||
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
${SHELL} ./check-os.sh ${LINES} ${COLUMNS}
|
||||||
|
|
||||||
|
error-stty:
|
||||||
|
@echo "No stty command here. Please manually specify size in the Makefile." >&2 ; false
|
||||||
|
|
||||||
|
has-stty:
|
||||||
|
which stty >/dev/null || $(MAKE) error-stty
|
||||||
|
|
||||||
|
fullscreen: has-stty
|
||||||
|
${MAKE} ${PROG} \
|
||||||
|
LINES=`stty size | sed -s 's/ .*$$//'` \
|
||||||
|
COLUMNS=`stty size | sed -s 's/^.* //'`
|
||||||
|
|
||||||
|
Darwin: ${PROG}.c
|
||||||
|
${RM} -f $@
|
||||||
|
${CC} ${CFLAGS} -Dg=392 \
|
||||||
|
-Ds=46 \
|
||||||
|
-DV=${LINES} \
|
||||||
|
-DW=${COLUMNS} \
|
||||||
|
$< -o ${PROG} ${LIBS}
|
||||||
|
${LN} ${PROG} $@
|
||||||
|
|
||||||
|
FreeBSD: ${PROG}.c
|
||||||
|
${RM} -f $@
|
||||||
|
${CC} ${CFLAGS} -Dg=392 \
|
||||||
|
-Ds=46 \
|
||||||
|
-DV=${LINES} \
|
||||||
|
-DW=${COLUMNS} \
|
||||||
|
$< -o ${PROG} ${LIBS}
|
||||||
|
${LN} ${PROG} $@
|
||||||
|
|
||||||
|
Linux: ${PROG}.c
|
||||||
|
${RM} -f $@
|
||||||
|
${CC} ${CFLAGS} -Dg=11 \
|
||||||
|
-Ds=0 \
|
||||||
|
-DV=${LINES} \
|
||||||
|
-DW=${COLUMNS} \
|
||||||
|
$< -o ${PROG} ${LIBS}
|
||||||
|
${LN} ${PROG} $@
|
||||||
|
|
||||||
# alternative executable
|
# alternative executable
|
||||||
#
|
#
|
||||||
alt: data ${ALT_TARGET}
|
alt: data ${ALT_TARGET}
|
||||||
@${TRUE}
|
@${TRUE}
|
||||||
|
|
||||||
|
${PROG}.alt:
|
||||||
|
$(MAKE) `${UNAME}`.alt
|
||||||
|
|
||||||
|
Darwin.alt: ${PROG}.alt.c
|
||||||
|
${RM} -f $@
|
||||||
|
${CC} ${CFLAGS} -Dg=392 \
|
||||||
|
-Ds=46 \
|
||||||
|
-DV=${LINES} \
|
||||||
|
-DW=${COLUMNS} \
|
||||||
|
$< -o ${PROG}.alt ${LIBS}
|
||||||
|
${LN} ${PROG}.alt $@
|
||||||
|
|
||||||
|
FreeBSD.alt: ${PROG}.alt.c
|
||||||
|
${RM} -f $@
|
||||||
|
${CC} ${CFLAGS} -Dg=392 \
|
||||||
|
-Ds=46 \
|
||||||
|
-DV=${LINES} \
|
||||||
|
-DW=${COLUMNS} \
|
||||||
|
$< -o ${PROG}.alt ${LIBS}
|
||||||
|
${LN} ${PROG}.alt $@
|
||||||
|
|
||||||
|
Linux.alt: ${PROG}.alt.c
|
||||||
|
${RM} -f $@
|
||||||
|
${CC} ${CFLAGS} -Dg=11 \
|
||||||
|
-Ds=0 \
|
||||||
|
-DV=${LINES} \
|
||||||
|
-DW=${COLUMNS} \
|
||||||
|
$< -o ${PROG}.alt ${LIBS}
|
||||||
|
${LN} ${PROG}.alt $@
|
||||||
|
|
||||||
# data files
|
# data files
|
||||||
#
|
#
|
||||||
data: ${DATA}
|
data: ${DATA}
|
||||||
@@ -220,6 +292,7 @@ clean:
|
|||||||
|
|
||||||
clobber: clean
|
clobber: clean
|
||||||
${RM} -f ${TARGET} ${ALT_TARGET}
|
${RM} -f ${TARGET} ${ALT_TARGET}
|
||||||
|
${RM} -f Darwin Darwin.alt FreeBSD FreeBSD.alt Linux Linux.alt
|
||||||
@-if [ -e sandwich ]; then \
|
@-if [ -e sandwich ]; then \
|
||||||
${RM} -f sandwich; \
|
${RM} -f sandwich; \
|
||||||
echo 'ate sandwich'; \
|
echo 'ate sandwich'; \
|
||||||
|
|||||||
+28
-24
@@ -1,32 +1,34 @@
|
|||||||
# Best collaborative graphics
|
# Best collaborative graphics
|
||||||
|
|
||||||
Etienne Duble
|
Etienne Duble
|
||||||
<https://lig-membres.imag.fr/duble>
|
<https://lig-membres.imag.fr/duble>
|
||||||
Twitter: @etienne_duble
|
Twitter: @etienne_duble
|
||||||
|
|
||||||
## To build:
|
# To build:
|
||||||
|
|
||||||
make all
|
```sh
|
||||||
|
make
|
||||||
|
```
|
||||||
|
|
||||||
### To run
|
### To run:
|
||||||
|
|
||||||
./prog file
|
```sh
|
||||||
|
./prog file
|
||||||
|
```
|
||||||
|
|
||||||
### Try:
|
### Try:
|
||||||
|
|
||||||
./prog /tmp/drawing
|
```sh
|
||||||
|
./prog /tmp/drawing
|
||||||
|
```
|
||||||
|
|
||||||
(open another window / terminal)
|
Open another window / terminal.
|
||||||
|
|
||||||
./prog /tmp/drawing
|
```sh
|
||||||
|
./prog /tmp/drawing
|
||||||
(open more terminals....)
|
```
|
||||||
|
|
||||||
./prog /tmp/drawing
|
|
||||||
|
|
||||||
|
|
||||||
NOTE: this entry does not work under at least some versions of macOS.
|
|
||||||
|
|
||||||
|
Open more terminals...
|
||||||
|
|
||||||
### Alternate code
|
### Alternate code
|
||||||
|
|
||||||
@@ -35,17 +37,19 @@ code might not work as well on macOS.
|
|||||||
|
|
||||||
To compile this alternate version:
|
To compile this alternate version:
|
||||||
|
|
||||||
make alt
|
```sh
|
||||||
|
make alt
|
||||||
|
```
|
||||||
|
|
||||||
Use `prog.alt` as you would `prog` above.
|
Use `prog.alt` as you would `prog` above.
|
||||||
|
|
||||||
|
## Judges' comments:
|
||||||
### Selected Judges' Remarks:
|
|
||||||
|
|
||||||
After starting the program, use the cursor keys, then try some modes, like "p"
|
After starting the program, use the cursor keys, then try some modes, like "p"
|
||||||
or "l" (they toggle).
|
or "l" (they toggle).
|
||||||
|
|
||||||
## Author's comments:
|
## Author's comments:
|
||||||
|
|
||||||
### Introduction
|
### Introduction
|
||||||
|
|
||||||
This program is a **graphics editor**, running on the terminal.
|
This program is a **graphics editor**, running on the terminal.
|
||||||
@@ -139,7 +143,9 @@ Note: the drawing files `prog` generates are probably even more portable than
|
|||||||
The default size is the one of my xterm (see top of Makefile).
|
The default size is the one of my xterm (see top of Makefile).
|
||||||
You may set it to the full size of your terminal window by typing:
|
You may set it to the full size of your terminal window by typing:
|
||||||
|
|
||||||
$ make fullscreen
|
```sh
|
||||||
|
make fullscreen
|
||||||
|
```
|
||||||
|
|
||||||
IMPORTANT NOTES:
|
IMPORTANT NOTES:
|
||||||
|
|
||||||
@@ -172,12 +178,10 @@ and it works on macOS too!
|
|||||||
I must confess it was challenging to remain below the size limit with this little
|
I must confess it was challenging to remain below the size limit with this little
|
||||||
change.
|
change.
|
||||||
|
|
||||||
|
## Copyright:
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
<!--
|
|
||||||
(c) Copyright 1984-2019, [Leo Broukhis, Simon Cooper, Landon Curt Noll][judges] - All rights reserved
|
(c) Copyright 1984-2019, [Leo Broukhis, Simon Cooper, Landon Curt Noll][judges] - All rights reserved
|
||||||
This work is licensed under a [Creative Commons Attribution-ShareAlike 3.0 Unported License][cc].
|
This work is licensed under a [Creative Commons Attribution-ShareAlike 3.0 Unported License][cc].
|
||||||
|
|
||||||
[judges]: http://www.ioccc.org/judges.html
|
[judges]: http://www.ioccc.org/judges.html
|
||||||
[cc]: http://creativecommons.org/licenses/by-sa/3.0/
|
[cc]: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
-->
|
|
||||||
Reference in new issue
Block a user