Files
Cody Boone Ferguson e6e5e282fb Important fixes in 2020/ferguson2
A typo in markdown meant that a link was not formed.

Renamed enigma.html to enigma.txt. Although it was to be set to viewed
as text the problem is that as a html file running a linter on it will
cause errors (obviously).

The .entry.json and all files that referred to the file enigma.html (not
in remote web servers, obviously, but just this website) now refer to
enigma.txt, except that enigma.html was now added to .gitignore and the
recode.md (in the example command) redirects to enigma.html as that
should be a html file, assuming they have the right key (of the
selection I gave).

These problems were not discovered due to trying to get the html files
in a good state (ironically) and knowing that I had written a lot.

I believe now that the files should be okay.

Although I did use sgit I did it carefully and I still ran make
quick-readme2index and make gen_other_html.
2024-11-02 07:24:35 -07:00

178 lines
3.6 KiB
Makefile

#!/usr/bin/env make
#
# IOCCC 2020 winning entry - ferguson2
################################################################################
#
# IOCCC winning entry code may not work on your system. What was liked/allowed
# and worked in the past may no longer be liked/allowed or compile/run today.
#
# Bug fixes, corrections and typo fixes are VERY WELCOME. If you see a problem,
# first check this URL for a list of known bugs and (mis)features of IOCCC entries:
#
# https://www.ioccc.org/bugs.html
#
# GitHub pull requests are welcome! Please see the above URL for details.
#
################################################################################
#
# This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
# You are free to share and adapt this file under the terms of this license:
#
# Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
#
# For more information, see: https://creativecommons.org/licenses/by-sa/4.0/
#############################
# shell used by this Makefile
#############################
#
SHELL= bash
#######################
# common tool locations
#######################
#
include ../../var.mk
# Common C compiler warnings to silence
#
CSILENCE= -Wno-empty-body -Wno-comment -Wno-implicit-function-declaration \
-Wno-misleading-indentation -Wno-unused-value -Wno-documentation
# Attempt to silence unknown warning option
#
CUNKNOWN= -Wno-unknown-warning-option
# Common C compiler warning flags
#
CWARN= -Wall -Wextra ${CSILENCE} ${CUNKNOWN}
# Compiler standard
#
CSTD= -std=gnu17
# Compiler bit architecture
#
ARCH=
# Defines that are needed to compile
#
CDEFINE= -D_POSIX_C_SOURCE=200809L
# Include files that are needed to compile
#
CINCLUDE=
# Optimization
#
OPT= -O3
# Default flags for ANSI C compilation
#
CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
# Libraries needed to build
#
LDFLAGS=
# C compiler to use
#
CC= cc
# Compiler add-ons or replacements for clang only
#
ifeq "$(findstring $(CLANG),${CC})" "$(CLANG)"
#
CSILENCE+= -Wno-implicit-int-conversion -Wno-missing-prototypes \
-Wno-missing-variable-declarations -Wno-poison-system-directories \
-Wno-shorten-64-to-32 -Wno-shadow -Wno-disabled-macro-expansion \
-Wno-unsafe-buffer-usage
#
CWARN+= -Weverything
#
endif
# Specific add-ons or replacements for gcc only
#
ifeq "$(findstring $(GCC),${CC})" "$(GCC)"
#
#CSILENCE+=
#
#CWARN+=
#
endif
##############################
# Special Makefile variables for this entry
##############################
#
ENTRY= ferguson2
PROG= prog
#
OBJ= ${PROG}.o
DATA= enigma.1 input.txt obfuscation.key \
obfuscation.md obfuscation.txt recode.1 recode.md \
try.this.txt enigma.txt
TARGET= ${PROG} recode
#
ALT_OBJ= ${PROG}.alt.o
ALT_TARGET= ${PROG}.alt
#################
# build the entry
#################
#
all: data ${TARGET}
@${TRUE}
.PHONY: all alt data everything clean clobber
${PROG}: ${PROG}.c
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
recode: recode.c
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
# alternative executable
#
alt: data ${ALT_TARGET}
@${TRUE}
# Variable to control how long to sleep for alternate code
#
SLEEP= 400000
${PROG}.alt: ${PROG}.alt.c
${CC} ${CFLAGS} -Dh=${SLEEP} $< -o $@ ${LDFLAGS}
# data files
#
data: ${DATA}
@${TRUE}
# both all and alt
#
everything: all alt
@${TRUE}
###############
# utility rules
###############
#
clean:
${RM} -f ${OBJ} ${ALT_OBJ}
clobber: clean
${RM} -f ${TARGET} ${ALT_TARGET}
${RM} -rf *.dSYM decrypted.html conf input output output2
######################################
# optional include of 1337 hacker rulz
######################################
-include 1337.mk ../1337.mk ../../1337.mk