fix Makefile and README.md for 2015/endoh4

This commit is contained in:
Landon Curt Noll committed 2023-03-24 20:17:37 -07:00
1 parent 9efc6a763d
commit 559542ebf4
2 files changed
+37 -32

No files matched your search

+12 -15
View File
@@ -63,20 +63,21 @@ X11_INCDIR= /opt/X11/include
# Common C compiler warnings to silence # Common C compiler warnings to silence
# #
#CSILENCE= #CSILENCE=
CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-main -Wno-return-type CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-implicit-int \
-Wno-main -Wno-pedantic -Wno-return-type
# 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
# #
#CSTD= #CSTD=
#CSTD= -ansi #CSTD= -ansi
CSTD= -std=gnu90 CSTD= -std=gnu11
# Compiler bit architecture # Compiler bit architecture
# #
@@ -101,8 +102,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
# #
@@ -126,7 +127,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
# #
@@ -138,8 +139,8 @@ CC= cc
# #
ifeq ($(CC),clang) ifeq ($(CC),clang)
# #
CSILENCE+= -Wno-comma -Wno-missing-prototypes -Wno-pedantic \ CSILENCE+= -Wno-comma -Wno-missing-prototypes -Wno-poison-system-directories \
-Wno-poison-system-directories -Wno-strict-prototypes -Wno-strict-prototypes
# #
CWARN+= -Weverything CWARN+= -Weverything
# #
@@ -167,8 +168,8 @@ OBJ= ${PROG}.o
DATA= DATA=
TARGET= ${PROG} TARGET= ${PROG}
# #
ALT_OBJ= ${PROG}.alt.o ALT_OBJ=
ALT_TARGET= ${PROG}.alt ALT_TARGET=
################# #################
@@ -185,9 +186,6 @@ all: data ${TARGET}
${PROG}: ${PROG}.c ${PROG}: ${PROG}.c
${CC} ${CFLAGS} $< -o $@ ${LIBS} ${CC} ${CFLAGS} $< -o $@ ${LIBS}
${PROG}.alt: ${PROG}.alt.c
${CC} ${CFLAGS} $< -o $@ ${LIBS}
# alternative executable # alternative executable
# #
alt: data ${ALT_TARGET} alt: data ${ALT_TARGET}
@@ -327,4 +325,3 @@ pluto: charon
@echo "dwarf is a type of planet" @echo "dwarf is a type of planet"
@echo "therefore, $@ is a planet" @echo "therefore, $@ is a planet"
@echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them"
+25 -17
View File
@@ -1,38 +1,47 @@
# Best One-liner # Best One-liner
Yusuke Endoh Yusuke Endoh
<https://github.com/mame/> <https://github.com/mame/>
Twitter: @mametter Twitter: @mametter
## To build: # To build:
make all ```sh
make
```
### To run ### To run:
./prog <a number of arguments> ```sh
./prog <a number of arguments>
```
### Try: ### Try:
./prog @ @ @ @ @ @ ```sh
./prog @ @ @ @ @ @
./prog @ @ @ @ @ @ @ @ @ @ @ @ ./prog @ @ @ @ @ @ @ @ @ @ @ @
./prog $(perl -e 'print "@ " x (2*3*5*7);') ./prog $(perl -e 'print "@ " x (2*3*5*7);')
./prog $(< Makefile) ./prog $(< Makefile)
```
### Alternate code ### Alternate code
An alternate version of this entry, prog.alt.c, is provided. This alternate code does not contain improvements suggested by Gil Dogon. An alternate version of this entry, `prog.alt.c`, is provided.
This alternate code does not contain improvements suggested by Gil Dogon.
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.
### Selected Judges Remarks: ## Judges' comments:
For this one liner it is best to avoid prime numbers. The output groups For this one liner it is best to avoid prime numbers. The output groups
factors in the x-y dimensions. How many factors can be represented before you factors in the x-y dimensions. How many factors can be represented before you
@@ -56,11 +65,10 @@ Inspired by [Animated Factorization Diagrams](http://www.datapointed.net/visuali
EDIT: `prog.alt.c` is the original version that I submitted. Gil Dogon kindly improved it during the review. Thank you! EDIT: `prog.alt.c` is the original version that I submitted. Gil Dogon kindly improved it during the review. Thank you!
-------------------------------------------------------------------------------- ## Copyright:
<!--
(c) Copyright 1984-2016, [Leo Broukhis, Simon Cooper, Landon Curt Noll][judges] - All rights reserved (c) Copyright 1984-2016, [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/
-->