mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-24 06:20:43 -08:00
606 lines
19 KiB
Text
606 lines
19 KiB
Text
# comm.gmk: COMMON GNUMAKEFILE FRAGMENT
|
|
#
|
|
# $Id$
|
|
# Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
|
|
#
|
|
# DESCRIPTION
|
|
#
|
|
# This makefile fragment is included in more specific makefiles for
|
|
# platforms which use GNU make.
|
|
#
|
|
# PARAMETERS
|
|
#
|
|
# Assumes the following variables and definitions:
|
|
# EXTRA_TARGETS a list of extra targets to build
|
|
# CFLAGSCOMPILER a list of flags for all compilations
|
|
# CFLAGSSTRICT a list of flags for almost all compilations
|
|
# CFLAGSLAX a list of flags for compilations which can't be as
|
|
# strict (e.g. because they have to include a third-
|
|
# party header file that isn't -ansi -pedantic).
|
|
# CFLAGSDEBUG a list of flags for compilations with maximum debug
|
|
# information, and any optimization possible
|
|
# CFLAGSOPT a list of flags for compilations with maximum
|
|
# optimization, and any debug info possible
|
|
# CC the command for the C compiler
|
|
# LINKFLAGS a list of flags passed to the linker
|
|
# ARFLAGSPFM platform-specific flags for ar
|
|
# RANLIB the command to index a library (default: none needed)
|
|
# gendep optionally defined to be a command sequence for
|
|
# generating the dependency file (.d) from a C file (.c);
|
|
# it is used in a rule of the form:
|
|
# $(PFM)/$(VARIETY)/%.d: %.c
|
|
# PFM platform code, e.g. "sus8gc"
|
|
# LIBS extra libraries to include in tests (usually "-lm")
|
|
# NOISY if defined and non-empty, causes commands to be emitted
|
|
# MPMPF platform-dependent C sources for the "mpm" part
|
|
# MPMS assembler sources for the "mpm" part (.s files)
|
|
# MPMPS pre-processor assembler sources for the "mpm" part (.S files)
|
|
#
|
|
# %%PART: When adding a new part, add a new parameter above for the
|
|
# files included in the part.
|
|
#
|
|
# EDITING
|
|
#
|
|
# To add new targets, varieties, and parts:
|
|
# Search for the string "%%TARGET", "%%VARIETY", or "%%PART" in this
|
|
# makefile and follow the instructions. If you're adding a part, you'll
|
|
# have to change the makefiles for all the platforms which use this
|
|
# makefile to define the source list for that part, and the GNUmakefile
|
|
# to include a recursive call to the name of that part.
|
|
#
|
|
# CHECK PARAMETERS
|
|
#
|
|
# GNU make doesn't really have an "error" directive, but these lines
|
|
# will cause it to exit with an error.
|
|
# [These only test to see whether the symbol is defined. We could be
|
|
# more thorough and test the syntax and content. -- richard 1995-09-07]
|
|
|
|
ifndef CC
|
|
error "comm.gmk: CC not defined"
|
|
endif
|
|
ifndef CFLAGSCOMPILER
|
|
error "comm.gmk: CFLAGSCOMPILER not defined"
|
|
endif
|
|
ifndef CFLAGSDEBUG
|
|
error "comm.gmk: CFLAGSDEBUG not defined"
|
|
endif
|
|
ifndef CFLAGSOPT
|
|
error "comm.gmk: CFLAGSOPT not defined"
|
|
endif
|
|
|
|
|
|
# EXTRA TARGETS
|
|
#
|
|
# Don't build mpseventsql by default (might not have sqlite3 installed),
|
|
# but do build mpseventcnv and mpseventtxt.
|
|
|
|
EXTRA_TARGETS ?= mpseventcnv mpseventtxt
|
|
|
|
|
|
#
|
|
# %%PART: When adding a new part, add checks for the parameter with the
|
|
# sources for the new part.
|
|
|
|
ifndef PFM
|
|
error "comm.gmk: PFM not defined"
|
|
endif
|
|
ifndef MPMPF
|
|
error "comm.gmk: MPMPF not defined"
|
|
endif
|
|
|
|
|
|
# DECLARATIONS
|
|
|
|
ifdef NOISY
|
|
ECHO = :
|
|
else
|
|
.SILENT:
|
|
ECHO = echo
|
|
endif
|
|
|
|
.PHONY: phony
|
|
|
|
|
|
# C FLAGS
|
|
|
|
# These flags are included in all compilations.
|
|
# Avoid using PFMDEFS in platform makefiles, as they prevent the MPS being
|
|
# built with a simple command like "cc -c mps.c".
|
|
CFLAGSCOMMON = $(PFMDEFS) $(CFLAGSCOMPILER) $(CFLAGSCOMPILERSTRICT)
|
|
CFLAGSCOMMONLAX = $(PFMDEFS) $(CFLAGSCOMPILER) $(CFLAGSCOMPILERLAX)
|
|
|
|
# %%VARIETY: When adding a new variety, define a macro containing the set
|
|
# of flags for the new variety.
|
|
|
|
# These flags are added to compilations for the indicated variety.
|
|
CFRASH = -DCONFIG_VAR_RASH -DNDEBUG $(CFLAGSOPT)
|
|
CFHOT = -DCONFIG_VAR_HOT -DNDEBUG $(CFLAGSOPT)
|
|
CFDIAG = -DCONFIG_VAR_DIAG -DNDEBUG $(CFLAGSOPT)
|
|
CFCOOL = -DCONFIG_VAR_COOL $(CFLAGSDEBUG)
|
|
|
|
# Bind CFLAGS to the appropriate set of flags for the variety.
|
|
# %%VARIETY: When adding a new variety, add a test for the variety and set
|
|
# CFLAGS here.
|
|
ifeq ($(VARIETY),rash)
|
|
CFLAGS=$(CFLAGSCOMMON) $(CFRASH)
|
|
CFLAGSLAX=$(CFLAGSCOMMONLAX) $(CFRASH)
|
|
else
|
|
ifeq ($(VARIETY),hot)
|
|
CFLAGS=$(CFLAGSCOMMON) $(CFHOT)
|
|
CFLAGSLAX=$(CFLAGSCOMMONLAX) $(CFHOT)
|
|
else
|
|
ifeq ($(VARIETY),diag)
|
|
CFLAGS=$(CFLAGSCOMMON) $(CFDIAG)
|
|
CFLAGSLAX=$(CFLAGSCOMMONLAX) $(CFDIAG)
|
|
else
|
|
ifeq ($(VARIETY),cool)
|
|
CFLAGS=$(CFLAGSCOMMON) $(CFCOOL)
|
|
CFLAGSLAX=$(CFLAGSCOMMONLAX) $(CFCOOL)
|
|
else
|
|
endif
|
|
endif
|
|
endif
|
|
endif
|
|
|
|
|
|
ARFLAGS=rc$(ARFLAGSPFM)
|
|
|
|
|
|
# == Common definitions ==
|
|
# %%PART: When adding a new part, add it here, unless it's platform-specific
|
|
# These values are defined here because they have no variation between
|
|
# platforms.
|
|
|
|
AMC = poolamc.c
|
|
AMS = poolams.c poolamsi.c
|
|
AWL = poolawl.c
|
|
LO = poollo.c
|
|
SNC = poolsnc.c
|
|
POOLN = pooln.c
|
|
MVFF = poolmvff.c
|
|
TESTLIB = testlib.c
|
|
FMTDY = fmtdy.c fmtno.c
|
|
FMTDYTST = fmtdy.c fmtno.c fmtdytst.c
|
|
FMTHETST = fmthe.c fmtdy.c fmtno.c fmtdytst.c
|
|
PLINTH = mpsliban.c mpsioan.c
|
|
EVENTPROC = eventcnv.c eventpro.c table.c
|
|
MPMCOMMON = mpsi.c mpm.c arenavm.c arenacl.c arena.c global.c locus.c \
|
|
tract.c walk.c reserv.c protocol.c pool.c poolabs.c \
|
|
trace.c traceanc.c root.c seg.c format.c buffer.c ref.c \
|
|
bt.c ring.c shield.c ld.c event.c sac.c message.c \
|
|
poolmrg.c poolmfs.c poolmv.c dbgpool.c dbgpooli.c \
|
|
boot.c meter.c splay.c cbs.c diag.c \
|
|
ss.c table.c
|
|
MPM = $(MPMCOMMON) $(MPMPF)
|
|
|
|
|
|
# These map the source file lists onto object files and dependency files
|
|
# in the platform/variety directory.
|
|
#
|
|
# %%PART: When adding a new part, add a new macro which expands to the files
|
|
# included in the part.
|
|
|
|
ifdef VARIETY
|
|
MPMOBJ = $(MPM:%.c=$(PFM)/$(VARIETY)/%.o) \
|
|
$(MPMS:%.s=$(PFM)/$(VARIETY)/%.o)
|
|
MPMDEP = $(MPM:%.c=$(PFM)/$(VARIETY)/%.d)
|
|
AMCOBJ = $(AMC:%.c=$(PFM)/$(VARIETY)/%.o)
|
|
AMCDEP = $(AMC:%.c=$(PFM)/$(VARIETY)/%.d)
|
|
AMSOBJ = $(AMS:%.c=$(PFM)/$(VARIETY)/%.o)
|
|
AMSDEP = $(AMS:%.c=$(PFM)/$(VARIETY)/%.d)
|
|
AWLOBJ = $(AWL:%.c=$(PFM)/$(VARIETY)/%.o)
|
|
AWLDEP = $(AWL:%.c=$(PFM)/$(VARIETY)/%.d)
|
|
LOOBJ = $(LO:%.c=$(PFM)/$(VARIETY)/%.o)
|
|
LODEP = $(LO:%.c=$(PFM)/$(VARIETY)/%.d)
|
|
SNCOBJ = $(SNC:%.c=$(PFM)/$(VARIETY)/%.o)
|
|
SNCDEP = $(SNC:%.c=$(PFM)/$(VARIETY)/%.d)
|
|
POOLNOBJ = $(POOLN:%.c=$(PFM)/$(VARIETY)/%.o)
|
|
POOLNDEP = $(POOLN:%.c=$(PFM)/$(VARIETY)/%.d)
|
|
MVFFOBJ = $(MVFF:%.c=$(PFM)/$(VARIETY)/%.o)
|
|
MVFFDEP = $(MVFF:%.c=$(PFM)/$(VARIETY)/%.d)
|
|
|
|
TESTLIBOBJ = $(TESTLIB:%.c=$(PFM)/$(VARIETY)/%.o)
|
|
TESTLIBDEP = $(TESTLIB:%.c=$(PFM)/$(VARIETY)/%.d)
|
|
FMTDYOBJ = $(FMTDY:%.c=$(PFM)/$(VARIETY)/%.o)
|
|
FMTDYDEP = $(FMTDY:%.c=$(PFM)/$(VARIETY)/%.d)
|
|
FMTDYTSTOBJ = $(FMTDYTST:%.c=$(PFM)/$(VARIETY)/%.o)
|
|
FMTHETSTOBJ = $(FMTHETST:%.c=$(PFM)/$(VARIETY)/%.o)
|
|
FMTHETSTDEP = $(FMTHETST:%.c=$(PFM)/$(VARIETY)/%.d)
|
|
PLINTHOBJ = $(PLINTH:%.c=$(PFM)/$(VARIETY)/%.o)
|
|
PLINTHDEP = $(PLINTH:%.c=$(PFM)/$(VARIETY)/%.d)
|
|
EVENTPROCOBJ = $(EVENTPROC:%.c=$(PFM)/$(VARIETY)/%.o)
|
|
EVENTPROCDEP = $(EVENTPROC:%.c=$(PFM)/$(VARIETY)/%.d)
|
|
endif
|
|
|
|
|
|
# == Pseudo-targets ==
|
|
|
|
# %%TARGET: When adding a new target, add it to the all dependencies
|
|
|
|
all: mpmss sacss amcss amcsshe amsss amssshe segsmss awlut awluthe \
|
|
mpsicv lockcov poolncv locv qs apss \
|
|
finalcv finaltest arenacv bttest teletest \
|
|
abqtest cbstest btcv mv2test messtest steptest \
|
|
walkt0 zcoll zmess \
|
|
$(EXTRA_TARGETS) \
|
|
mps.a mpsplan.a
|
|
|
|
|
|
# Runs the automatic tests that are built with CONFIG_PROD_MPS.
|
|
# These tests are run overnight (see design.buildsys.overnight).
|
|
# bttest & teletest cannot be run unattended
|
|
# mv2test cannot be run because MV2 is broken
|
|
# %%TARGET: When adding a new target, if target is suitable for the
|
|
# overnight tests, then add it here.
|
|
TESTCASES=abqtest amcss amcsshe amcssth amsss amssshe apss arenacv awlut \
|
|
awluthe btcv cbstest finalcv finaltest lockcov locv \
|
|
messtest mpmss mpsicv poolncv qs sacss segsmss steptest \
|
|
walkt0
|
|
testrun: $(TESTCASES)
|
|
OUTPUT=$$(mktemp /tmp/mps-XXXXXX.log); \
|
|
echo "Logging test output to $$OUTPUT"; \
|
|
$(^:%=(TESTCASE=$(PFM)/$(VARIETY)/%; \
|
|
echo "\n\n-- Running $$TESTCASE at $$(date) --" >> $$OUTPUT && \
|
|
echo "Running $$TESTCASE" && \
|
|
$$TESTCASE >> $$OUTPUT) &&) true
|
|
|
|
# These convenience targets allow one to type "make foo" to build target
|
|
# foo in selected varieties (or none, for the latter rule).
|
|
#
|
|
# %%TARGET: When adding a new target, add a pseudo-target for it here.
|
|
|
|
mpmss sacss amcss amcssth amcsshe amsss amssshe segsmss awlut awlutth \
|
|
awluthe mpsicv lockcov poolncv locv qs apss \
|
|
finalcv finaltest arenacv bttest teletest \
|
|
expt825 \
|
|
abqtest cbstest btcv mv2test \
|
|
messtest steptest \
|
|
walkt0 \
|
|
exposet0 \
|
|
zcoll zmess \
|
|
$(EXTRA_TARGETS) replay replaysw \
|
|
mps.a mpsplan.a: phony
|
|
ifdef VARIETY
|
|
$(MAKE) -f $(PFM).gmk TARGET=$@ variety
|
|
else
|
|
$(MAKE) -f $(PFM).gmk TARGET=$@ target
|
|
endif
|
|
|
|
|
|
# "clean" removes the directory containing the build results for the
|
|
# platform.
|
|
|
|
clean: phony
|
|
$(ECHO) "$(PFM): $@"
|
|
rm -rf "$(PFM)"
|
|
|
|
# "target" builds some varieties of the target named in the TARGET macro.
|
|
# %%VARIETY: When adding a new target, optionally add a recursive make call
|
|
# for the new variety, if it should be built by default. It probably
|
|
# shouldn't without a product design decision and an update of the readme
|
|
# and build manual!
|
|
|
|
ifdef TARGET
|
|
ifndef VARIETY
|
|
target: phony
|
|
$(MAKE) -f $(PFM).gmk VARIETY=hot variety
|
|
$(MAKE) -f $(PFM).gmk VARIETY=cool variety
|
|
endif
|
|
endif
|
|
|
|
|
|
# "variety" builds the target named in the TARGET macro using the
|
|
# variety named in the VARIETY macro.
|
|
|
|
ifdef VARIETY
|
|
ifdef TARGET
|
|
variety: $(PFM)/$(VARIETY)/$(TARGET)
|
|
endif
|
|
endif
|
|
|
|
|
|
# THE MPS LIBRARY
|
|
#
|
|
# The MPS library is built in two ways:
|
|
#
|
|
# 1. In the usual way, from a pile of object files compiled from their
|
|
# corresponding sources.
|
|
#
|
|
# 2. From mps.c, which effectively concatenates all the sources, allowing
|
|
# important global optimisation and inlining to occur.
|
|
#
|
|
# We mostly use the method (2), because it is fast to compile and execute.
|
|
# But we use method (1) for some varieties to ensure correctness of
|
|
# code (linkage errors are masked by (2)) and to maintain a correct list
|
|
# of source files in case method (1) won't work on some future constrained
|
|
# platform.
|
|
#
|
|
# %%VARIETY: When adding a new variety, add a rule for how to build the
|
|
# MPS library for the variety.
|
|
|
|
$(PFM)/rash/mps.a: $(PFM)/rash/mps.o
|
|
$(PFM)/hot/mps.a: $(PFM)/hot/mps.o
|
|
|
|
$(PFM)/diag/mps.a: \
|
|
$(MPMOBJ) $(AMCOBJ) $(AMSOBJ) $(AWLOBJ) $(LOOBJ) $(SNCOBJ) \
|
|
$(MVFFOBJ) $(PLINTHOBJ) $(POOLNOBJ)
|
|
$(PFM)/cool/mps.a: \
|
|
$(MPMOBJ) $(AMCOBJ) $(AMSOBJ) $(AWLOBJ) $(LOOBJ) $(SNCOBJ) \
|
|
$(MVFFOBJ) $(PLINTHOBJ) $(POOLNOBJ)
|
|
|
|
|
|
# OTHER GENUINE TARGETS
|
|
#
|
|
# Each line defines an executable or library target to be built and the
|
|
# object files it is built from. These lines add dependencies to the
|
|
# generic rules below, and should not include commands to execute.
|
|
#
|
|
# %%TARGET: When adding a new target, add the dependencies for the new target
|
|
# here.
|
|
|
|
ifdef VARIETY
|
|
|
|
$(PFM)/$(VARIETY)/finalcv: $(PFM)/$(VARIETY)/finalcv.o \
|
|
$(FMTDYTSTOBJ) $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/finaltest: $(PFM)/$(VARIETY)/finaltest.o \
|
|
$(FMTDYTSTOBJ) $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/expt825: $(PFM)/$(VARIETY)/expt825.o \
|
|
$(FMTDYTSTOBJ) $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/locv: $(PFM)/$(VARIETY)/locv.o \
|
|
$(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/mpmss: $(PFM)/$(VARIETY)/mpmss.o \
|
|
$(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/apss: $(PFM)/$(VARIETY)/apss.o \
|
|
$(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/sacss: $(PFM)/$(VARIETY)/sacss.o \
|
|
$(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/bttest: $(PFM)/$(VARIETY)/bttest.o \
|
|
$(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/teletest: $(PFM)/$(VARIETY)/teletest.o \
|
|
$(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/lockcov: $(PFM)/$(VARIETY)/lockcov.o \
|
|
$(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/mpsicv: $(PFM)/$(VARIETY)/mpsicv.o \
|
|
$(FMTDYTSTOBJ) $(FMTHETSTOBJ) $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/amcss: $(PFM)/$(VARIETY)/amcss.o \
|
|
$(FMTDYTSTOBJ) $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/amcssth: $(PFM)/$(VARIETY)/amcssth.o \
|
|
$(FMTDYTSTOBJ) $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/amcsshe: $(PFM)/$(VARIETY)/amcsshe.o \
|
|
$(FMTHETSTOBJ) $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/amsss: $(PFM)/$(VARIETY)/amsss.o \
|
|
$(FMTDYTSTOBJ) $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/amssshe: $(PFM)/$(VARIETY)/amssshe.o \
|
|
$(FMTHETSTOBJ) $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/segsmss: $(PFM)/$(VARIETY)/segsmss.o \
|
|
$(FMTDYTSTOBJ) $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/awlut: $(PFM)/$(VARIETY)/awlut.o \
|
|
$(FMTDYTSTOBJ) $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/awluthe: $(PFM)/$(VARIETY)/awluthe.o \
|
|
$(FMTHETSTOBJ) $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/awlutth: $(PFM)/$(VARIETY)/awlutth.o \
|
|
$(FMTDYTSTOBJ) $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/poolncv: $(PFM)/$(VARIETY)/poolncv.o \
|
|
$(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/qs: $(PFM)/$(VARIETY)/qs.o \
|
|
$(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/arenacv: $(PFM)/$(VARIETY)/arenacv.o \
|
|
$(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/abqtest: $(PFM)/$(VARIETY)/abqtest.o \
|
|
$(PFM)/$(VARIETY)/abq.o $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/cbstest: $(PFM)/$(VARIETY)/cbstest.o \
|
|
$(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/btcv: $(PFM)/$(VARIETY)/btcv.o \
|
|
$(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/mv2test: $(PFM)/$(VARIETY)/mv2test.o \
|
|
$(PFM)/$(VARIETY)/poolmv2.o $(PFM)/$(VARIETY)/abq.o \
|
|
$(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/messtest: $(PFM)/$(VARIETY)/messtest.o \
|
|
$(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/steptest: $(PFM)/$(VARIETY)/steptest.o \
|
|
$(FMTDYTSTOBJ) $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/walkt0: $(PFM)/$(VARIETY)/walkt0.o \
|
|
$(FMTDYTSTOBJ) $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/exposet0: $(PFM)/$(VARIETY)/exposet0.o \
|
|
$(FMTDYTSTOBJ) $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/zcoll: $(PFM)/$(VARIETY)/zcoll.o \
|
|
$(FMTDYTSTOBJ) $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/zmess: $(PFM)/$(VARIETY)/zmess.o \
|
|
$(FMTDYTSTOBJ) $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/mpseventcnv: $(PFM)/$(VARIETY)/eventcnv.o \
|
|
$(PFM)/$(VARIETY)/eventpro.o $(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/mpseventtxt: $(PFM)/$(VARIETY)/eventtxt.o \
|
|
$(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/mpseventsql: $(PFM)/$(VARIETY)/eventsql.o \
|
|
$(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/replay: $(PFM)/$(VARIETY)/replay.o \
|
|
$(PFM)/$(VARIETY)/eventrep.o \
|
|
$(PFM)/$(VARIETY)/eventpro.o $(PFM)/$(VARIETY)/table.o \
|
|
$(PFM)/$(VARIETY)/mps.a
|
|
|
|
$(PFM)/$(VARIETY)/mpsplan.a: $(PLINTHOBJ)
|
|
|
|
endif
|
|
|
|
|
|
# GENERIC RULES
|
|
#
|
|
# These generate build output in the <pfm>/<variety> directory.
|
|
|
|
# Object files
|
|
|
|
define run-cc
|
|
$(ECHO) "$(PFM): $@"
|
|
mkdir -p $(PFM)
|
|
mkdir -p $(PFM)/$(VARIETY)
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
endef
|
|
|
|
define run-cc-lax
|
|
$(ECHO) "$(PFM): $@ - compiling with lax flags."
|
|
mkdir -p $(PFM)
|
|
mkdir -p $(PFM)/$(VARIETY)
|
|
$(CC) $(CFLAGSLAX) -c -o $@ $<
|
|
endef
|
|
|
|
# .rule.c-to-o:
|
|
$(PFM)/$(VARIETY)/%.o: %.c
|
|
$(run-cc)
|
|
|
|
$(PFM)/$(VARIETY)/eventsql.o: eventsql.c
|
|
$(run-cc-lax)
|
|
|
|
$(PFM)/$(VARIETY)/%.o: %.s
|
|
$(run-cc)
|
|
|
|
$(PFM)/$(VARIETY)/%.o: %.S
|
|
$(run-cc)
|
|
|
|
# Dependencies
|
|
#
|
|
# These are included into _this_ makefile (see below). GNU make does the
|
|
# right thing as long as it knows how to make the dependency files before
|
|
# including them.
|
|
|
|
ifdef gendep
|
|
|
|
$(PFM)/$(VARIETY)/%.d: %.c
|
|
$(ECHO) "$(PFM): $@"
|
|
mkdir -p $(PFM)
|
|
mkdir -p $(PFM)/$(VARIETY)
|
|
$(gendep)
|
|
|
|
ifdef VARIETY
|
|
ifdef TARGET
|
|
|
|
# %%VARIETY: When adding a new variety, add the dependencies files for it
|
|
# here.
|
|
ifeq ($(VARIETY),rash)
|
|
include $(PFM)/$(VARIETY)/mps.d
|
|
else
|
|
ifeq ($(VARIETY),hot)
|
|
include $(PFM)/$(VARIETY)/mps.d
|
|
else
|
|
# %%PART: When adding a new part, add the dependency file macro for the new
|
|
# part here.
|
|
include $(MPMDEP) $(AMSDEP) $(AMCDEP) $(LODEP) \
|
|
$(AWLDEP) $(POOLNDEP) $(TESTLIBDEP) $(FMTDYDEP) $(FMTHETSTDEP) \
|
|
$(PLINTHDEP) $(EVENTPROCDEP)
|
|
endif
|
|
endif
|
|
|
|
endif
|
|
endif
|
|
|
|
endif
|
|
|
|
# Library
|
|
|
|
ifndef RANLIB
|
|
RANLIB = :
|
|
endif
|
|
|
|
$(PFM)/$(VARIETY)/%.a:
|
|
$(ECHO) "$(PFM): $@"
|
|
rm -f $@
|
|
$(CC) $(CFLAGS) -c -o $(PFM)/$(VARIETY)/version.o version.c
|
|
$(AR) $(ARFLAGS) $@ $^ $(PFM)/$(VARIETY)/version.o
|
|
$(RANLIB) $@
|
|
|
|
# Executable
|
|
|
|
$(PFM)/$(VARIETY)/%:
|
|
$(ECHO) "$(PFM): $@"
|
|
$(CC) $(CFLAGS) $(LINKFLAGS) -o $@ $^ $(LIBS)
|
|
|
|
$(PFM)/$(VARIETY)/mpseventsql:
|
|
$(ECHO) "$(PFM): $@"
|
|
$(CC) $(CFLAGS) $(LINKFLAGS) -o $@ $^ $(LIBS) -lsqlite3
|
|
|
|
# Special targets for development
|
|
|
|
# Currently FreeBSD 7 GCC 4.2.1 is the best platform we have for warning
|
|
# us about strict aliasing rule violations caused by type puns. This
|
|
# target reveals them, and produces an assembler output file that can be
|
|
# examined to see if they're actually dangerous. RB 2012-09-07
|
|
|
|
find-puns: phony
|
|
{ echo '#include "mps.c"'; echo '#include "fmtdy.c"'; } | \
|
|
gcc -S -fverbose-asm -ansi -pedantic -Wall -Wstrict-aliasing=2 -O3 -x c -o pun.s -
|
|
|
|
|
|
# C. COPYRIGHT AND LICENSE
|
|
#
|
|
# Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
|
# All rights reserved. This is an open source license. Contact
|
|
# Ravenbrook for commercial licensing options.
|
|
#
|
|
# Redistribution and use in source and binary forms, with or without
|
|
# modification, are permitted provided that the following conditions are
|
|
# met:
|
|
#
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
# notice, this list of conditions and the following disclaimer.
|
|
#
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
# notice, this list of conditions and the following disclaimer in the
|
|
# documentation and/or other materials provided with the distribution.
|
|
#
|
|
# 3. Redistributions in any form must be accompanied by information on how
|
|
# to obtain complete source code for this software and any accompanying
|
|
# software that uses this software. The source code must either be
|
|
# included in the distribution or be available for no more than the cost
|
|
# of distribution plus a nominal fee, and must be freely redistributable
|
|
# under reasonable conditions. For an executable file, complete source
|
|
# code means the source code for all modules it contains. It does not
|
|
# include source code for modules or files that typically accompany the
|
|
# major components of the operating system on which the executable file
|
|
# runs.
|
|
#
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
|
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
# PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
# COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
|
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|