X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=Makefile;h=afd81a099480bd0da6d103abb8e44fe8e6d45f66;hb=refs%2Fheads%2Fmaster;hp=1b88b81d8e8398c7b693eaff3dca3688ff3e9763;hpb=24d7aeaf8a1dc13034884044139728045604fc37;p=open-adventure.git diff --git a/Makefile b/Makefile index 1b88b81..0da7fb8 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,158 @@ -# NOTE: This version of Adventure was developed by the author on private -# equipment, and has been ported to Sun for entertainment purposes only. -# The author (Don Woods) retains full rights to the work. +# Makefile for the open-source release of adventure 2.5 -OBJS=main.o init.o actions1.o actions2.o score.o misc.o datime.o +# SPDX-FileCopyrightText: (C) Eric S. Raymond +# SPDX-License-Identifier: BSD-2-Clause + +# To build with save/resume disabled, pass CFLAGS="-DADVENT_NOSAVE" +# To build with auto-save/resume enabled, pass CFLAGS="-DADVENT_AUTOSAVE" + +VERS=$(shell sed -n MANIFEST + @(ln -s . advent-$(VERS)) + (tar -T MANIFEST -czvf advent-$(VERS).tar.gz) + @(rm advent-$(VERS)) -adventure: $(OBJS) - gcc -O $(DBX) -o adventure $(OBJS) +release: advent-$(VERS).tar.gz advent.html history.html hints.html notes.html + shipper version=$(VERS) | sh -e -x -main.o: misc.h funcs.h +refresh: advent.html notes.html history.html + shipper -N -w version=$(VERS) | sh -e -x -init.o: misc.h main.h share.h funcs.h +dist: advent-$(VERS).tar.gz -actions1.o: misc.h main.h share.h funcs.h +linty: CCFLAGS += -W +linty: CCFLAGS += -Wall +linty: CCFLAGS += -Wextra +linty: CCGLAGS += -Wpedantic +linty: CCFLAGS += -Wundef +linty: CCFLAGS += -Wstrict-prototypes +linty: CCFLAGS += -Wmissing-prototypes +linty: CCFLAGS += -Wmissing-declarations +linty: CCFLAGS += -Wshadow +linty: CCFLAGS += -Wnull-dereference +linty: CCFLAGS += -Wjump-misses-init +linty: CCFLAGS += -Wfloat-equal +linty: CCFLAGS += -Wcast-align +linty: CCFLAGS += -Wwrite-strings +linty: CCFLAGS += -Waggregate-return +linty: CCFLAGS += -Wcast-qual +linty: CCFLAGS += -Wswitch-enum +linty: CCFLAGS += -Wwrite-strings +linty: CCFLAGS += -Wunreachable-code +linty: CCFLAGS += -Winit-self +linty: CCFLAGS += -Wpointer-arith +linty: advent cheat -actions2.o: misc.h main.h share.h funcs.h +# These seem to be more modern options for enabling coverage testing. +# Documenting them here in case a future version bump disables --coverage. +#debug: CCFLAGS += -ftest-coverage +#debug: CCFLAGS += -fprofile-arcs -score.o: misc.h main.h share.h +debug: CCFLAGS += -O0 +debug: CCFLAGS += --coverage +debug: CCFLAGS += -ggdb +debug: CCFLAGS += -U_FORTIFY_SOURCE +debug: CCFLAGS += -fsanitize=address +debug: CCFLAGS += -fsanitize=undefined +debug: linty -misc.o: misc.h main.h