DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: M T

⟦b8dd28333⟧ TextFile

    Length: 4938 (0x134a)
    Types: TextFile
    Names: »Makefile.gcc«

Derivation

└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
    └─⟦this⟧ »EUUGD18/General/Scrabble/Makefile.gcc« 

TextFile


# RCS Info: $Revision: 1.2 $ on $Date: 89/03/15 11:16:17 $
#           $Source: /yew3/faustus/src/scrabble/RCS/Makefile,v $
# Copyright (c) 1987 Wayne A. Christopher, U. C. Berkeley CAD Group
#
# Program Makefile
#
# This makefile has the standard options "clean", "require", and "install".
# Also available are "lint", "depend", "tags", "opt", "debug", and "prof".
# "opt" causes the program to be compiled optimized, "debug" with -g, and
# "prof" with -pg.  As an added bonus, the Makefile remembers the last of
# these options given.

what: all

#---- Tool specific stuff ----

DICT_DEF = -DDICT_FILE=\"/usr/dict/words\"
SYS_DEF	 = -DUNIX -DBSD

PROGRAM = scrabble

SRC	=		\
	board.c		\
	dict.c		\
	move.c		\
	player.c	\
	savegame.c	\
	scrabble.c	\
	tty.c		\
	user.c		\
	util.c refresh.c

OBJ	=		\
	board.o		\
	dict.o		\
	move.o		\
	player.o	\
	savegame.o	\
	scrabble.o	\
	tty.o		\
	user.o		\
	util.o refresh.o

HDR	=		\
	scrabble.h	\
	util.h

SUPPORT		=	plural

SABER_HDR = scrabble.h

REQUIRE =

SPEC_OPT_LIBS 	=

SPEC_DEBUG_LIBS	=

SPEC_PROF_LIBS 	=

SPEC_LINT_LIBS	=

SPEC_INCLUDE	= -I. -I../include

SPEC_DEFINES	= $(DICT_DEF) $(SYS_DEF)

MAN_SECTION	= 1

DOC		=

MISC		=

CC = gcc -W -fwritable-strings

OPT_LIBS = $(SPEC_OPT_LIBS)

DEBUG_LIBS = $(SPEC_DEBUG_LIBS)

PROF_LIBS = $(SPEC_PROF_LIBS)

#OPT_LDFLAGS = -lcurses -ltermlib -lX -lm -O
OPT_LDFLAGS = -lcurses -ltermlib -lm -O

DEBUG_LDFLAGS = -lcurses -ltermlib -lX -lm -g

PROF_LDFLAGS = -lcurses -ltermlib -lX_p -lm_p -pg

MAN_PAGE	= $(PROGRAM).$(MAN_SECTION)

#---- State ----

#CFLAGS=-O -g
CFLAGS=-g
LIBS=$(OPT_LIBS)
LDFLAGS=$(OPT_LDFLAGS)

#---- Generic stuff ----

# EXTDEFINES are things that come from a higher-level Makefile

EXTDEFINES =

DEFINES	= $(EXT_DEFINES) $(SPEC_DEFINES)

INCLUDE = $(SPEC_INCLUDE)

LINT_LIBS = $(SPEC_LINT_LIB)

LINT_FLAGS = -DLINT -u -z -lc

.c.o: $*.c
	$(CC) $(DEFINES) $(INCLUDE) $(CFLAGS) -c $*.c

all: date.h $(PROGRAM) $(SUPPORT) .saberinit
	@echo "All done."

$(PROGRAM): $(OBJ) $(LIBS)
	rm -f $(PROGRAM)
	$(CC) -o $(PROGRAM) $(OBJ) $(LIBS) $(LDFLAGS)

$(SUPPORT): $(SUPPORT).o
	rm -f $(SUPPORT)
	$(CC) -o $(SUPPORT) $(SUPPORT).o $(LIBS) $(LDFLAGS)

date.h: /tmp
	@echo \#define DATE \"`date`\" > date.h
	@echo \#define HOST \"`hostname`\" >> date.h
	@echo \#define USER \"`whoami`\" >> date.h

#---- Stuff that changes our state ----

opt:
	@-if	egrep -s '^CFLAGS=-O' Makefile ; then \
		echo already -O ... ; \
	else	echo converting from $(CFLAGS) to -O ; \
		sed -e 's/^CFLAGS=.*$$/CFLAGS=-O/' \
			-e 's/^LIBS=.*$$/LIBS=\$$\(OPT_LIBS\)/' \
			-e 's/^LDFLAGS=.*$$/LDFLAGS=\$$\(OPT_LDFLAGS\)/' \
			< Makefile > mktemp ; \
		mv mktemp Makefile ; \
		rm *.o ; \
	fi
	@make $(MFLAGS)

debug:
	@-if	egrep -s '^CFLAGS=-g' Makefile ; then \
		echo already -g ... ; \
	else	echo converting from $(CFLAGS) to -g ; \
		sed -e 's/^CFLAGS=.*$$/CFLAGS=-g/' \
			-e 's/^LIBS=.*$$/LIBS=\$$\(DEBUG_LIBS\)/' \
			-e 's/^LDFLAGS=.*$$/LDFLAGS=\$$\(DEBUG_LDFLAGS\)/' \
			< Makefile > mktemp ; \
		mv mktemp Makefile ; \
		rm *.o ; \
	fi
	@make $(MFLAGS)

prof:
	@-if	egrep -s '^CFLAGS=-pg' Makefile ; then \
		echo already -pg -O ... ; \
	else	echo converting from $(CFLAGS) to -pg -O  ; \
		sed -e 's/^CFLAGS=.*$$/CFLAGS=-pg -O/' \
			-e 's/^LIBS=.*$$/LIBS=\$$\(PROF_LIBS\)/' \
			-e 's/^LDFLAGS=.*$$/LDFLAGS=\$$\(PROF_LDFLAGS\)/' \
			< Makefile > mktemp ; \
		mv mktemp Makefile ; \
		rm *.o ; \
	fi
	@make $(MFLAGS)

checkin:
	ci $(SRC) $(HDR) $(MAN_PAGE) Makefile $(DOC) $(MISC) </dev/null
	rcs -U $(SRC) $(HDR) $(MAN_PAGE) Makefile $(DOC) $(MISC)

checkout:
	co $(SRC) $(HDR) $(MAN_PAGE) $(DOC) $(MISC) </dev/null

#---- Stuff for lint ----

lint:	$(SRC) $(HDR)
	lint $(LINT_FLAGS) $(DEFINES) $(INCLUDE) $(SRC) $(LINT_LIBS)

#---- Stuff for "make install" ----

#install: $(INSTALLED) $(MAN_INSTALLED)
#
#$(INSTALLED): $(TARGET)
#	cp $(TARGET) $(INSTALLED)
#	strip $(TARGET) $(INSTALLED)
#
#$(MAN_INSTALLED): $(MAN_PAGE)
#	cp $(MAN_PAGE) $(MAN_INSTALLED)

#---- Misc junk ----

dist:
	rdist -Rich $(SRC) $(SUPPSRC) $(HDR) $(MAN_PAGE) $(DOC) \
			$(MISC) Makefile $(DIST)

print:
	psgrind -2r -Plps $(HDR) $(SRC) $(SUPPSRC)

require:
	@echo $(REQUIRE)

clean:
	rm -f $(TARGET) $(SUPPORT) $(OBJ) $(SUPPOBJ) tags *.out foo tmp

tags: $(SRC) $(HDR) $(SUPPSRC)
	ctags -w -t $(SRC) $(HDR) $(SUPPSRC) > /dev/null 2>&1

depend: $(SRC) $(SUPPSRC)
	cc -M $(DEFINES) $(INCLUDE) $(CFLAGS) $(SRC) $(SUPPSRC) > makedep
	echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
	echo '$$r makedep' >>eddep
	echo 'w' >>eddep
	ed - Makefile < eddep
	rm eddep makedep 
	echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
	echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
	echo '# see make depend above' >> Makefile

.saberinit: Makefile
	@echo load $(SRC) $(LIBS) $(LDFLAGS)  > .saberinit

#-----------------------------------------------------------------
# DO NOT DELETE THIS LINE -- make depend uses it
# DEPENDENCIES MUST END AT END OF FILE