fix Makefile and README.md for 2015/endoh4
This commit is contained in:
1 parent
9efc6a763d
commit
559542ebf4
2 files changed
+37
-32
No files matched your search
+12
-15
@@ -63,20 +63,21 @@ X11_INCDIR= /opt/X11/include
|
||||
# Common C compiler warnings to silence
|
||||
#
|
||||
#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
|
||||
#
|
||||
#CWARN= ${CSILENCE}
|
||||
#CWARN= -Wall ${CSILENCE}
|
||||
CWARN= -Wall -Wextra ${CSILENCE}
|
||||
#CWARN= -Wall -Wextra -pedantic ${CSILENCE}
|
||||
#CWARN= -Wall -Wextra ${CSILENCE}
|
||||
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
|
||||
|
||||
# Compiler standard
|
||||
#
|
||||
#CSTD=
|
||||
#CSTD= -ansi
|
||||
CSTD= -std=gnu90
|
||||
CSTD= -std=gnu11
|
||||
|
||||
# Compiler bit architecture
|
||||
#
|
||||
@@ -101,8 +102,8 @@ CINCLUDE=
|
||||
#CINCLUDE= -include stdlib.h
|
||||
#CINCLUDE= -include stdio.h
|
||||
#CINCLUDE= -include stdlib.h -include stdio.h
|
||||
#CINCLUDE= -I ${X11_INCDIR}
|
||||
#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
|
||||
#CINCLUDE= -I ${X11_INCDIR} -I ${X11_INCDIR}/X11
|
||||
#CINCLUDE= `${SDL2_CONFIG} --cflags`
|
||||
|
||||
# Optimization
|
||||
#
|
||||
@@ -126,7 +127,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
||||
LIBS=
|
||||
#LIBS= -lm
|
||||
#LIBS= -L ${X11_LIBDIR} -lX11
|
||||
#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL
|
||||
#LIBS= `${SDL2_CONFIG} --libs`
|
||||
|
||||
# C compiler to use
|
||||
#
|
||||
@@ -138,8 +139,8 @@ CC= cc
|
||||
#
|
||||
ifeq ($(CC),clang)
|
||||
#
|
||||
CSILENCE+= -Wno-comma -Wno-missing-prototypes -Wno-pedantic \
|
||||
-Wno-poison-system-directories -Wno-strict-prototypes
|
||||
CSILENCE+= -Wno-comma -Wno-missing-prototypes -Wno-poison-system-directories \
|
||||
-Wno-strict-prototypes
|
||||
#
|
||||
CWARN+= -Weverything
|
||||
#
|
||||
@@ -167,8 +168,8 @@ OBJ= ${PROG}.o
|
||||
DATA=
|
||||
TARGET= ${PROG}
|
||||
#
|
||||
ALT_OBJ= ${PROG}.alt.o
|
||||
ALT_TARGET= ${PROG}.alt
|
||||
ALT_OBJ=
|
||||
ALT_TARGET=
|
||||
|
||||
|
||||
#################
|
||||
@@ -185,9 +186,6 @@ all: data ${TARGET}
|
||||
${PROG}: ${PROG}.c
|
||||
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
||||
|
||||
${PROG}.alt: ${PROG}.alt.c
|
||||
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
||||
|
||||
# alternative executable
|
||||
#
|
||||
alt: data ${ALT_TARGET}
|
||||
@@ -327,4 +325,3 @@ pluto: charon
|
||||
@echo "dwarf is a type of planet"
|
||||
@echo "therefore, $@ is a planet"
|
||||
@echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them"
|
||||
|
||||
+25
-17
@@ -1,38 +1,47 @@
|
||||
# Best One-liner
|
||||
|
||||
Yusuke Endoh
|
||||
<https://github.com/mame/>
|
||||
Twitter: @mametter
|
||||
Yusuke Endoh
|
||||
<https://github.com/mame/>
|
||||
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:
|
||||
|
||||
./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
|
||||
|
||||
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:
|
||||
|
||||
make alt
|
||||
```sh
|
||||
make alt
|
||||
```
|
||||
|
||||
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
|
||||
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!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
<!--
|
||||
## Copyright:
|
||||
|
||||
(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].
|
||||
|
||||
[judges]: http://www.ioccc.org/judges.html
|
||||
[cc]: http://creativecommons.org/licenses/by-sa/3.0/
|
||||
-->
|
||||
Reference in new issue
Block a user