From: David Griffith Date: Mon, 16 Dec 2013 10:30:27 +0000 (-0800) Subject: Shiny new Makefile. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=0372af5117034b8116b24b6f63db83a406990113;p=liskon_frotz.git Shiny new Makefile. --- diff --git a/Makefile b/Makefile index 27ee5cb..0ff635a 100644 --- a/Makefile +++ b/Makefile @@ -2,86 +2,57 @@ # MacOS users should use "cc" even though it's really "gcc". # CC = gcc -#CC = cc -# Define your optimization flags. Most compilers understand -O and -O2, -# Standard (note: Solaris on UltraSparc using gcc 2.8.x might not like this.) +# Define your optimization flags. # -OPTS = -O2 -g +# These are good for regular use. +OPTS = -O2 -fomit-frame-pointer -falign-functions=2 -falign-loops=2 -falign-jumps=2 +# These are handy for debugging. +#OPTS = -O2 -g -Wall -# Pentium with gcc 2.7.0 or better -#OPTS = -O2 -fomit-frame-pointer -malign-functions=2 -malign-loops=2 \ -#-malign-jumps=2 - -# Define where you want Frotz installed. Usually this is /usr/local +# Define where you want Frotz installed (typically /usr/local). +# PREFIX = /usr/local - MAN_PREFIX = $(PREFIX) -#MAN_PREFIX = /usr/local/share - -CONFIG_DIR = $(PREFIX)/etc -#CONFIG_DIR = /etc +CONFIG_DIR = /etc +#CONFIG_DIR = $(PREFIX)/etc -# Define where you want Frotz to look for frotz.conf. +# Sound support requires +# If you want to compile Frotz with no sound support, uncomment this line: # -CONFIG_DIR = /usr/local/etc -#CONFIG_DIR = /etc -#CONFIG_DIR = /usr/pkg/etc -#CONFIG_DIR = +#NO_SOUND = -DNO_SOUND -# Uncomment this if you want color support. Most, but not all curses -# libraries that work with Frotz will support color. -# -COLOR_DEFS = -DCOLOR_SUPPORT -# Uncomment this if you have an OSS soundcard driver and want classical -# Infocom sound support. -# -#SOUND_DEFS = -DOSS_SOUND +########################################################################## +# The configuration options below are intended mainly for older flavors +# of Unix. For Linux, BSD, and Solaris released since 2003, you can +# ignore this section. +########################################################################## -# Uncomment this too if you're running BSD of some sort and are using -# the OSS sound driver. +# If your machine's version of curses doesn't support color, comment this out. # -#SOUND_LIB = -lossaudio +COLOR_DEFS = -DCOLOR_SUPPORT -# Define your sound device -# This should probably be a command-line/config-file option. +# If this matters, you can choose libcurses or libncurses. # -#SOUND_DEV = /dev/dsp -#SOUND_DEV = /dev/sound -#SOUND_DEV = /dev/audio +CURSES = -lncurses +#CURSES = -lcurses -# If your vendor-supplied curses library won't work, uncomment the -# location where ncurses.h is. +# Just in case your operating system keeps its user-added header files +# somewhere unusual... # #INCL = -I/usr/local/include #INCL = -I/usr/pkg/include #INCL = -I/usr/freeware/include #INCL = -I/5usr/include -#INCL = -I/path/to/ncurses.h -# If your vendor-supplied curses library won't work, uncomment the -# location where the ncurses library is. +# Just in case your operating system keeps its user-added libraries +# somewhere unusual... # #LIB = -L/usr/local/lib #LIB = -L/usr/pkg/lib #LIB = -L/usr/freeware/lib #LIB = -L/5usr/lib -#LIB = -L/path/to/libncurses.so - -# One of these must always be uncommented. If your vendor-supplied -# curses library won't work, comment out the first option and uncomment -# the second. -# -CURSES = -lcurses -#CURSES = -lncurses - -# Uncomment this if your need to use ncurses instead of the -# vendor-supplied curses library. This just tells the compile process -# which header to include, so don't worry if ncurses is all you have -# (like on Linux). You'll be fine. -# -#CURSES_DEF = -DUSE_NCURSES_H # Uncomment this if you're compiling Unix Frotz on a machine that lacks # the memmove(3) system call. If you don't know what this means, leave it @@ -89,31 +60,17 @@ CURSES = -lcurses # #MEMMOVE_DEF = -DNO_MEMMOVE -# Uncomment this if for some wacky reason you want to compile Unix Frotz -# under Cygwin under Windoze. This sort of thing is not reccomended. -# -#EXTENSION = .exe - -SDLINC = `sdl-config --cflags` -FTCFLAGS = `freetype-config --cflags` -FTLIBS = `freetype-config --libs` - -SDL_DEFS = $(SDLINC) $(FTCFLAGS) $(FTLIBS) -SDL_LIBS = -ljpeg -lpng -lz -lSDL -lSDL_mixer -##################################################### -# Nothing under this line should need to be changed. -##################################################### +######################################################################### +# This section is where Frotz is actually built. +# Under normal circumstances, nothing in this section should be changed. +######################################################################### SRCDIR = src - -VERSION = 2.44pre - +VERSION = 2.44 NAME = frotz BINNAME = $(NAME) - DISTFILES = bugtest - DISTNAME = $(BINNAME)-$(VERSION) distdir = $(DISTNAME) @@ -150,7 +107,6 @@ CURSES_OBJECT = $(CURSES_DIR)/ux_init.o \ $(CURSES_DIR)/ux_audio.o \ $(CURSES_DIR)/ux_resource.o # $(CURSES_DIR)/ux_audio_none.o \ -# $(CURSES_DIR)/ux_audio_oss.o DUMB_DIR = $(SRCDIR)/dumb DUMB_TARGET = $(SRCDIR)/frotz_dumb.a @@ -159,22 +115,6 @@ DUMB_OBJECT = $(DUMB_DIR)/dumb_init.o \ $(DUMB_DIR)/dumb_output.o \ $(DUMB_DIR)/dumb_pic.o -SDL_DIR = $(SRCDIR)/sdl -SDL_TARGET = $(SRCDIR)/frotz_sdl.a -SDL_OBJECT = $(SDL_DIR)/sf_aiffwav.o \ - $(SDL_DIR)/sf_deffont.o \ - $(SDL_DIR)/sf_font3.o \ - $(SDL_DIR)/sf_fonts.o \ - $(SDL_DIR)/sf_ftype.o \ - $(SDL_DIR)/sf_images.o \ - $(SDL_DIR)/sf_msg_en.o \ - $(SDL_DIR)/sf_osfdlg.o \ - $(SDL_DIR)/sf_resample.o \ - $(SDL_DIR)/sf_resource.o \ - $(SDL_DIR)/sf_sig.o \ - $(SDL_DIR)/sf_sound.o \ - $(SDL_DIR)/sf_util.o \ - $(SDL_DIR)/sf_video.o # Blorb file handling # @@ -182,19 +122,18 @@ BLORB_DIR = $(SRCDIR)/blorb BLORB_TARGET = $(SRCDIR)/blorblib.a BLORB_OBJECT = $(BLORB_DIR)/blorblib.o - TARGETS = $(COMMON_TARGET) $(CURSES_TARGET) $(BLORB_TARGET) OPT_DEFS = -DCONFIG_DIR="\"$(CONFIG_DIR)\"" $(CURSES_DEF) \ -DVERSION="\"$(VERSION)\"" -CURSES_DEFS = $(OPT_DEFS) $(COLOR_DEFS) $(SOUND_DEFS) $(SOUNDCARD) \ - $(MEMMOVE_DEF) +CURSES_DEFS = $(OPT_DEFS) $(COLOR_DEFS) $(SOUND_DEF) $(MEMMOVE_DEF) FLAGS = $(OPTS) $(CURSES_DEFS) $(INCL) SOUND_LIB = -lao -ldl -lm -lsndfile -lvorbisfile -lmodplug + $(NAME): $(NAME)-curses curses: $(NAME)-curses $(NAME)-curses: $(COMMON_TARGET) $(CURSES_TARGET) $(BLORB_TARGET) @@ -205,11 +144,6 @@ d$(NAME): $(NAME)-dumb $(NAME)-dumb: $(COMMON_TARGET) $(DUMB_TARGET) $(CC) -o d$(BINNAME)$(EXTENSION) $(COMMON_TARGET) $(DUMB_TARGET) $(LIB) -sdl: $(NAME)-sdl -s$(NAME): $(NAME)-sdl -$(NAME)-sdl: $(COMMON_TARGET) $(SDL_TARGET) $(BLORB_TARGET) - $(CC) -o s$(BINNAME) $(COMMON_TARGET) $(SDL_TARGET) $(BLORB_TARGET) $(SDL_LIBS) - all: $(NAME) d$(NAME) @@ -228,9 +162,6 @@ $(DUMB_OBJECT): %.o: %.c $(CURSES_OBJECT): %.o: %.c $(CC) $(OPTS) $(CURSES_DEFS) -o $@ -c $< -$(SDL_OBJECT): %.o: %.c - $(CC) $(OPTS) $(SDL_DEFS) -o $@ -c $< - # If you're going to make this target manually, you'd better know which # config target to make first. @@ -243,7 +174,7 @@ $(COMMON_TARGET): $(COMMON_OBJECT) ranlib $(COMMON_TARGET) @echo -curses_lib: config_curses $(CURSES_TARGET) +curses_lib: $(CURSES_TARGET) $(CURSES_TARGET): $(CURSES_OBJECT) @echo @echo "Archiving curses interface code..." @@ -259,14 +190,6 @@ $(DUMB_TARGET): $(DUMB_OBJECT) ranlib $(DUMB_TARGET) @echo -sdl_lib: $(SDL_TARGET) -$(SDL_TARGET): $(SDL_OBJECT) - @echo - @echo "Archiving SDL interface code..." - ar rc $(SDL_TARGET) $(SDL_OBJECT) - ranlib $(SDL_TARGET) - @echo - blorb_lib: $(BLORB_TARGET) $(BLORB_TARGET): $(BLORB_OBJECT) @echo @@ -275,12 +198,6 @@ $(BLORB_TARGET): $(BLORB_OBJECT) ranlib $(BLORB_TARGET) @echo - -soundcard.h: - @if [ ! -f $(SRCDIR)/soundcard.h ] ; then \ - sh $(SRCDIR)/misc/findsound.sh $(SRCDIR); \ - fi - install: $(NAME) strip $(BINNAME)$(EXTENSION) install -d $(PREFIX)/bin @@ -338,7 +255,6 @@ distclean: clean -rm -f $(distdir).tar $(distdir).tar.gz realclean: distclean - clobber: distclean help: