mirror of
https://github.com/wrog/lambdamoo
synced 2026-08-13 00:26:05 -04:00
379 lines
12 KiB
Makefile
379 lines
12 KiB
Makefile
# Copyright (c) 1992, 1995, 1996 Xerox Corporation. All rights reserved.
|
|
# Portions of this code were written by Stephen White, aka ghond.
|
|
# Use and copying of this software and preparation of derivative works based
|
|
# upon this software are permitted. Any distribution of this software or
|
|
# derivative works must comply with all applicable United States export
|
|
# control laws. This software is made available AS IS, and Xerox Corporation
|
|
# makes no warranty about the software, its performance or its conformity to
|
|
# any specification. Any person obtaining a copy of this software is requested
|
|
# to send their name and post office or electronic mail address to:
|
|
# Pavel Curtis
|
|
# Xerox PARC
|
|
# 3333 Coyote Hill Rd.
|
|
# Palo Alto, CA 94304
|
|
# Pavel@Xerox.Com
|
|
|
|
VPATH = @srcdir@
|
|
srcdir = @srcdir@
|
|
abs_srcdir = @abs_srcdir@
|
|
abs_builddir = @abs_builddir@
|
|
@TEST_MAKEVARS@
|
|
@SET_MAKE@
|
|
|
|
# XT_MAKEVARS -----
|
|
@XT_MAKEVARS@
|
|
|
|
XT_DIRS = @XT_DIRS@
|
|
XT_LOBJS = @XT_LOBJS@
|
|
|
|
CC = @CC@
|
|
LIBS = @LIBS@
|
|
YACC = @YACC@
|
|
|
|
CFLAGS = @CFLAGS@
|
|
CPPFLAGS = -I$(abs_builddir) -I$(abs_srcdir) @CPPFLAGS@
|
|
LDFLAGS = @LDFLAGS@
|
|
|
|
YFLAGS = -d
|
|
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
|
|
GPERF = @GPERF@
|
|
|
|
COMMON_CSRCS = \
|
|
ast.c code_gen.c db_file.c db_io.c db_objects.c db_properties.c \
|
|
db_tune.c db_verbs.c decompile.c disassemble.c eval_env.c \
|
|
eval_vm.c exceptions.c execute.c experiments.c functions.c \
|
|
list.c log.c match.c md5.c name_lookup.c network.c net_mplex.c \
|
|
net_proto.c numbers.c objects.c parse_cmd.c program.c \
|
|
property.c quota.c ref_count.c server.c storage.c \
|
|
streams.c str_intern.c sym_table.c tasks.c timers.c unparse.c \
|
|
utf-ctype.c utils.c verbs.c version.c
|
|
|
|
XT_CSRCS = @XT_CSRCS@
|
|
ALL_XT_CSRCS = @ALL_XT_CSRCS@
|
|
|
|
OPT_NET_SRCS = net_single.c net_multi.c \
|
|
net_mp_selct.c net_mp_poll.c net_mp_fake.c \
|
|
net_tcp.c \
|
|
net_bsd_tcp.c net_bsd_lcl.c net_sysv_tcp.c net_sysv_lcl.c
|
|
|
|
YSRCS = parser.y
|
|
|
|
COMMON_HDRS = ast.h code_gen.h config_epilog.h \
|
|
db.h db_io.h db_private.h decompile.h db_tune.h \
|
|
disassemble.h eval_env.h eval_vm.h exceptions.h \
|
|
execute.h experiments.h functions.h \
|
|
getpagesize.h keywords.h list.h log.h match.h \
|
|
md5.h name_lookup.h network.h net_mplex.h net_multi.h \
|
|
net_proto.h numbers.h opcode.h options_epilog.h \
|
|
parse_cmd.h parser.h pattern.h program.h quota.h random.h \
|
|
ref_count.h server.h storage.h streams.h structures.h \
|
|
str_intern.h sym_table.h tasks.h timers.h tokens.h \
|
|
unparse.h utf.h utf-ctype.h utils.h verbs.h version.h waif.h
|
|
|
|
XT_HDRS = @XT_HDRS@
|
|
ALL_XT_HDRS = @ALL_XT_HDRS@
|
|
|
|
SYSHDRS = my-ctype.h my-fcntl.h my-in.h my-inet.h my-ioctl.h my-math.h \
|
|
my-poll.h my-signal.h my-socket.h my-stat.h my-stdarg.h my-stdio.h \
|
|
my-stdlib.h my-string.h my-stropts.h my-sys-time.h my-time.h \
|
|
my-tiuser.h my-types.h my-unistd.h my-wait.h
|
|
|
|
CLIENT_CSRCS = client_bsd.c client_sysv.c
|
|
|
|
ALL_CSRCS = $(COMMON_CSRCS) $(OPT_NET_SRCS) $(ALL_XT_CSRCS) $(CLIENT_CSRCS)
|
|
|
|
ALL_SRCS = $(ALL_CSRCS) keywords.gperf $(YSRCS) \
|
|
$(COMMON_HDRS) $(ALL_XT_HDRS) $(SYSHDRS)
|
|
|
|
M4_SRCS = ax_gcc_func_attribute.m4 ax_gcc_var_attribute.m4 \
|
|
ax_lp.m4 ax_xt.m4 moo_xt.m4 moo_options.m4 \
|
|
moo_arguments.m4 moo_cflags.m4 moo_decl.m4 \
|
|
moo_iconv.m4 moo_net.m4 moo_netopt.m4 \
|
|
moo_sys_ancient.m4 \
|
|
moo_git.m4 moo_svf.m4 moo_svf_mk.m4 \
|
|
moo_svf_mk0.mk moo_svf_mk1.mk
|
|
|
|
DISTFILES = $(ALL_SRCS) Makefile.in config.h.in options.h.in \
|
|
bf_register.h.in bf_register.c.in bf_register.sh \
|
|
ChangeLog.txt \
|
|
README.md README.rX README.1997 \
|
|
Extensions.md Version_Source.md \
|
|
MOOCodeSequences.txt AddingNewMOOTypes.txt \
|
|
configure.ac extensions.ac extensions2_tutorial.ac \
|
|
options.ac aclocal.m4 \
|
|
restart restart.sh Minimal.db README.Minimal
|
|
|
|
DISTGENS = configure keywords.c $(YSRCS:.y=.c) y.tab.h
|
|
|
|
COBJS = $(COMMON_CSRCS:.c=.o) $(XT_CSRCS:.c=.o)
|
|
|
|
YOBJS = $(YSRCS:.y=.o)
|
|
|
|
OBJS = $(COBJS) $(YOBJS) keywords.o bf_register.o
|
|
|
|
DFILES = $(OBJS:.o=.d) $(CLIENT_CSRCS:.c=.d)
|
|
|
|
all: moo
|
|
|
|
moo: $(OBJS) $(XT_LOBJS)
|
|
$(CC) $(LDFLAGS) $(OBJS) $(XT_LOBJS) $(LIBS) -o $@
|
|
|
|
pure_moo: moo
|
|
purify $(CC) $(CFLAGS) $(OBJS) $(XT_LOBJS) $(LIBS) -o $@
|
|
|
|
client_bsd: client_bsd.o
|
|
$(CC) $(CFLAGS) client_bsd.o $(XT_LOBJS) $(LIBS) -o $@
|
|
|
|
client_sysv: client_sysv.o
|
|
$(CC) $(CFLAGS) client_sysv.o $(XT_LOBJS) $(LIBS) -o $@
|
|
|
|
# This rule gets around some "make"s' desire to `derive' it from `restart.sh'.
|
|
restart:
|
|
touch restart
|
|
|
|
configure version_options.h: configure.ac options.ac extensions.ac aclocal.m4 $(abs_srcdir)/ac_include/*.m4
|
|
@echo "[ $@ : $? ]"
|
|
( cd $(srcdir) ; autoconf )
|
|
|
|
config.status: configure
|
|
./config.status --recheck
|
|
|
|
Makefile config.h options.h: config.lastrun
|
|
|
|
config.lastrun: config.status Makefile.in config.h.in options.h.in
|
|
@echo "[ $? ]"
|
|
./config.status
|
|
|
|
y.tab.h: parser.o
|
|
|
|
# The LambdaMOO server project originally shipped with a lightly
|
|
# hacked version 2.1 of GNU gperf, renamed 'pgperf', now removed;
|
|
# see commit log for full history.
|
|
keywords.c: keywords.gperf
|
|
$(GPERF) --language=ANSI-C --ignore-case --readonly-tables \
|
|
--struct-type --omit-struct-type -c -l \
|
|
--initializer-suffix=,0,0,-1 \
|
|
--lookup-function-name=find_keyword \
|
|
--output-file="$@" $<
|
|
|
|
bf_register.h bf_register.c: bf_register.lastrun ;
|
|
bf_register.lastrun: bf_register.h.in bf_register.c.in bf_register.sh $(COMMON_CSRCS) $(XT_CSRCS) Makefile
|
|
sh $(abs_srcdir)/bf_register.sh $(abs_srcdir) $(COMMON_CSRCS) -- $(ALL_XT_CSRCS) -- $(XT_CSRCS)
|
|
|
|
# the only dependences we have to add are
|
|
# those on files that are automatically generated
|
|
keywords.o: y.tab.h
|
|
$(COBJS): bf_register.h
|
|
|
|
# XT_RULES ---------
|
|
@XT_RULES@
|
|
# TEST_RULES ---------
|
|
@TEST_RULES@
|
|
# --- distribution ---------
|
|
distribution: version.lastck $(DISTFILES) $(DISTGENS) $(M4_SRCS:%=ac_include/%)
|
|
rm -f dist_version_number dist_hash_temp dist_manifest dist_version.fixed
|
|
printf "%s\n" $(DISTFILES) $(DISTGENS) $(M4_SRCS:%=ac_include/%) >dist_manifest
|
|
for F in `cat dist_manifest` ; do \
|
|
case ' $(DISTGENS) ' in *" $$F "*) continue ;; esac ;\
|
|
git hash-object "$$F" >>dist_hash_temp ;\
|
|
done
|
|
moo_no_write=: ;. ./version.lastck ;\
|
|
case $$moo_EXT in *[?]*) \
|
|
moo_EXT=`printf %s\n $$moo_EXT | sed s/[?].*/-NOCOMMIT/` ;; \
|
|
esac ;\
|
|
printf "$$moo_MAJOR.$$moo_MINOR.$${moo_RELEASE}$${moo_EXT}\n" \
|
|
> dist_version_number ;\
|
|
printf "moo_%s='%s'\n" \
|
|
MAJOR $$moo_MAJOR MINOR $$moo_MINOR \
|
|
RELEASE $$moo_RELEASE EXT $$moo_EXT \
|
|
UHASH_RELEASE `git hash-object dist_hash_temp` \
|
|
DEFSRC "$$moo_DEFSRC" > dist_version.fixed
|
|
distdir=MOO-`cat dist_version_number` ;\
|
|
distfile=LambdaMOO-`cat dist_version_number`.tar.gz ;\
|
|
rm -fr $$distdir; mkdir $$distdir; chmod 755 $$distdir;\
|
|
mkdir $$distdir/ac_include ;\
|
|
cp -p `grep -Ev '^ac_include/' dist_manifest` $$distdir ;\
|
|
cp -p `grep -E '^ac_include/' dist_manifest` $$distdir/ac_include ;\
|
|
mv dist_manifest $$distdir/MANIFEST ;\
|
|
mv dist_version.fixed $$distdir/version.fixed ;\
|
|
touch $$distdir/clean-keeps-parser $$distdir/clean-keeps-keywords ;\
|
|
chmod -w extensions2_tutorial.ac ;\
|
|
tar cfpvz dist.tar.gz-NEW $$distdir &&\
|
|
{ mv dist.tar.gz-NEW dist.tar.gz ;\
|
|
rm -rf $$distfile $$distdir \
|
|
dist_version_number dist_hash_temp ;\
|
|
ln dist.tar.gz $$distfile ; }
|
|
|
|
tags:
|
|
etags -t $(ALL_SRCS)
|
|
|
|
clean-all: clean
|
|
@for dir in $(XT_DIRS); do $(MAKE) -C $$dir clean; done
|
|
|
|
distclean-all: distclean
|
|
@for dir in $(XT_DIRS); do $(MAKE) -C $$dir distclean; done
|
|
|
|
gitclean-all: gitclean distclean-all
|
|
|
|
clean: clean-keeps-moo clean-keeps-parser clean-keeps-keywords $(TEST_CLEAN)
|
|
rm -f $(OBJS) $(DFILES) core \
|
|
version_src.h version_make.* \
|
|
bf_register.h bf_register.c bf_register.lastrun
|
|
|
|
distclean: clean $(TEST_DISTCLEAN)
|
|
rm -rf config.h options.h Makefile config.status config.cache config.log config.lastrun \
|
|
version.lastck version_options.h
|
|
|
|
gitclean: distclean $(TEST_GITCLEAN)
|
|
rm -rf configure autom4te.cache version.fixed
|
|
|
|
clean-keeps-keywords:
|
|
rm -f keywords.c
|
|
|
|
clean-keeps-parser:
|
|
rm -f parser.c y.tab.h y.output
|
|
|
|
clean-keeps-moo:
|
|
rm -f moo
|
|
|
|
|
|
.SUFFIXES: .c .o .i .s
|
|
.c.o:
|
|
${CC} ${CPPFLAGS} -MMD -MP ${CFLAGS} -c -o $@ $<
|
|
.c.i:
|
|
${CC} ${CPPFLAGS} ${CFLAGS} -E -o $@ $<
|
|
.c.s:
|
|
${CC} ${CPPFLAGS} ${CFLAGS} -S -o $@ $<
|
|
|
|
# -MMD: write 'target.o: dep1 dep2 ...' into target.d
|
|
# -MP: include 'dep1:','dep2:'... lines in target.d (rm depN forces remake)
|
|
sinclude $(DFILES)
|
|
|
|
version.o: version_options.h version_src.h version_make.h
|
|
|
|
version_src.h: version.lastck
|
|
./version.lastck >$@
|
|
|
|
version.lastck: FORCE
|
|
@./config.status $@
|
|
|
|
FORCE:
|
|
|
|
@version_make_frag@
|
|
|
|
###############################################################################
|
|
# $Log$
|
|
# Revision 2.10 1996/04/19 01:28:40 pavel
|
|
# Ran a new `make depend'. Release 1.8.0p4.
|
|
#
|
|
# Revision 2.9 1996/03/10 01:31:24 pavel
|
|
# Added pgperf directory and aclocal.m4 file to the distribution.
|
|
# Release 1.8.0.
|
|
#
|
|
# Revision 2.8 1996/02/18 23:18:02 pavel
|
|
# Added md5.[ch]. Release 1.8.0beta3.
|
|
#
|
|
# Revision 2.7 1996/02/08 07:26:19 pavel
|
|
# Updated copyright notice for 1996. Release 1.8.0beta1 (again).
|
|
#
|
|
# Revision 2.6 1996/02/08 05:46:27 pavel
|
|
# Added numbers.h, AddingNewMOOTypes.txt. Updated dependencies. Made pure_moo
|
|
# depend on moo. Release 1.8.0beta1.
|
|
#
|
|
# Revision 2.5 1996/01/16 07:35:55 pavel
|
|
# Fixed dependencies. Release 1.8.0alpha6.
|
|
#
|
|
# Revision 2.4 1996/01/11 07:58:54 pavel
|
|
# Fixed dependencies for parser.o. Release 1.8.0alpha5.
|
|
#
|
|
# Revision 2.3 1995/12/31 03:29:29 pavel
|
|
# Fixed dependencies for parser.y and the networking modules.
|
|
# Release 1.8.0alpha4.
|
|
#
|
|
# Revision 2.2 1995/12/28 00:32:32 pavel
|
|
# Added verbs.h. Release 1.8.0alpha3.
|
|
#
|
|
# Revision 2.1 1995/12/11 08:07:47 pavel
|
|
# Added a few more derived files to `make clean'. Release 1.8.0alpha2.
|
|
#
|
|
# Revision 2.0 1995/11/30 05:45:03 pavel
|
|
# New baseline version, corresponding to release 1.8.0alpha1.
|
|
#
|
|
# Revision 1.26 1992/10/23 23:10:29 pavel
|
|
# Updated dependency information for release 1.7.0 and added copyright notice.
|
|
#
|
|
# Revision 1.25 1992/10/23 19:12:08 pavel
|
|
# A few last portability changes for release 1.7.0.
|
|
#
|
|
# Revision 1.24 1992/10/21 03:02:35 pavel
|
|
# Converted to use new automatic configuration system.
|
|
#
|
|
# Revision 1.23 1992/10/17 20:14:17 pavel
|
|
# Numerous changes in response to beta-testing portability problems.
|
|
#
|
|
# Revision 1.22 1992/10/06 01:32:41 pavel
|
|
# Dyked out useless XNS network support.
|
|
# Added sources for clients and a few new my-*.h files.
|
|
# Fixed nasty bug in `make depend' code.
|
|
#
|
|
# Revision 1.21 1992/09/23 17:23:08 pavel
|
|
# Added support for the whole family of networking protocol and multiplexing
|
|
# wait implementations; it should now be easy to add new `optional' sources,
|
|
# only used if certain combinations of preprocessor flags are set.
|
|
#
|
|
# Revision 1.20 1992/09/14 18:42:47 pjames
|
|
# Updated.
|
|
#
|
|
# Revision 1.19 1992/09/14 17:46:39 pjames
|
|
# Updated.
|
|
#
|
|
# Revision 1.18 1992/09/08 22:49:59 pjames
|
|
# Took out bf_move.c
|
|
#
|
|
# Revision 1.17 1992/09/08 22:09:23 pjames
|
|
# Updated for new bf_ filenames
|
|
#
|
|
# Revision 1.16 1992/09/03 23:49:13 pavel
|
|
# Added support for multiple complete network implementations.
|
|
#
|
|
# Revision 1.15 1992/09/03 16:32:40 pjames
|
|
# Updated.
|
|
#
|
|
# Revision 1.14 1992/08/31 23:43:57 pavel
|
|
# Added math library to the LIBRARIES line for A/UX.
|
|
#
|
|
# Revision 1.13 1992/08/28 16:32:18 pjames
|
|
# Added ref_count modules.
|
|
#
|
|
# Revision 1.12 1992/08/21 01:09:56 pavel
|
|
# Minor fix.
|
|
#
|
|
# Revision 1.11 1992/08/21 00:56:39 pavel
|
|
# Shortened the names of several files to fit within the 14-character limit
|
|
# imposed on certain systems.
|
|
# Moved the specification of all configuration options other than those
|
|
# directly related to the compiler command line into config.h. Also
|
|
# reorganized the ones that are left to make it easier for folks to see what's
|
|
# necessary.
|
|
#
|
|
# Revision 1.10 1992/08/14 00:35:21 pavel
|
|
# Fixed rule for dist.tar.Z to be idempotent.
|
|
#
|
|
# Revision 1.9 1992/08/13 23:35:42 pavel
|
|
# Cleaned up CFLAGS organization.
|
|
#
|
|
# Revision 1.8 1992/08/13 23:24:34 pavel
|
|
# Did a more recent `make depend'...
|
|
#
|
|
# Revision 1.7 1992/08/13 22:48:20 pjames
|
|
# Added my-math.h
|
|
#
|
|
# Revision 1.6 1992/08/13 21:29:58 pjames
|
|
# Added -DMOO to COMPILE.c
|
|
#
|
|
# Revision 1.5 1992/08/11 17:06:45 pjames
|
|
# Updated with new source files, removed old source files, fixed dependencies.
|
|
#
|
|
# Revision 1.3 1992/07/27 18:30:21 pjames
|
|
# Update what vector.o and vector.po depend on.
|
|
###############################################################################
|