Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: d457b6513b
Fetching contributors…

Cannot retrieve contributors at this time

541 lines (378 sloc) 16.609 kB
###############################################################################
# This file must be modified by editing config/gen/makefiles/root.in
###############################################################################
O = ${o}
SO = ${so}
A = ${a}
RM_F = ${rm_f}
RM_RF = ${rm_rf}
AR_CR = ${ar} cr
RANLIB = ${ranlib}
LD = ${ld}
LD_SHARED = ${ld_shared}
LD_OUT = ${ld_out}
LD_SHARED_FLAGS=${ld_shared_flags}
INC=include/parrot
###############################################################################
#
# "STICKY" GENERATED FILES:
#
# These files are created when Configure.pl runs.
#
# We don't delete these on 'clean' only on 'realclean'.
# That way, we don't have to re-Configure.pl after making
# clean.
#
###############################################################################
GEN_MAKEFILES = Makefile classes/Makefile languages/Makefile docs/Makefile \
languages/jako/Makefile languages/miniperl/Makefile languages/scheme/Makefile
GEN_CONFIGS = include/parrot/config.h include/parrot/platform.h \
lib/Parrot/Config.pm platform.c
STICKY_FILES = $(GEN_CONFIGS) $(GEN_MAKEFILES) config.opt
###############################################################################
#
# "FLUID" GENERATED FILES:
#
# These files are created during the build process.
#
# We *do* delete these on 'clean'.
#
###############################################################################
GEN_OPSFILES =
GEN_HEADERS = $(INC)/vtable.h $(INC)/oplib/core_ops.h \
$(INC)/oplib/core_ops_prederef.h
GEN_SOURCES = core_ops.c core_ops_prederef.c
GEN_MODULES = lib/Parrot/Jit.pm lib/Parrot/PMC.pm lib/Parrot/OpLib/core.pm
FLUID_FILES = $(GEN_OPSFILES) $(GEN_HEADERS) $(GEN_SOURCES) $(GEN_MODULES)
###############################################################################
#
# OTHER FILE GROUPS:
#
###############################################################################
GENERAL_H_FILES = $(INC)/config.h $(INC)/exceptions.h $(INC)/io.h $(INC)/op.h \
$(INC)/register.h $(INC)/string.h $(INC)/events.h $(INC)/interpreter.h \
$(INC)/memory.h $(INC)/parrot.h $(INC)/stacks.h $(INC)/packfile.h \
$(INC)/global_setup.h $(INC)/vtable.h $(INC)/oplib/core_ops.h \
$(INC)/oplib/core_ops_prederef.h $(INC)/runops_cores.h $(INC)/trace.h \
$(INC)/pmc.h $(INC)/key.h $(INC)/hash.h $(INC)/resources.h $(INC)/platform.h ${cg_h} \
$(INC)/interp_guts.h $(INC)/rx.h $(INC)/rxstacks.h \
$(INC)/embed.h $(INC)/warnings.h $(INC)/misc.h $(INC)/pmc.h \
$(INC)/key.h $(INC)/hash.h $(INC)/smallobject.h $(INC)/headers.h $(INC)/dod.h \
$(INC)/method_util.h
ALL_H_FILES = $(GENERAL_H_FILES)
O_DIRS = classes
CLASS_O_FILES = ${pmc_classes_o}
ENCODING_O_FILES = encodings/singlebyte$(O) encodings/utf8$(O) \
encodings/utf16$(O) \
encodings/utf32$(O)
CHARTYPE_O_FILES = chartypes/unicode$(O) chartypes/usascii$(O)
IO_O_FILES = io/io$(O) io/io_buf$(O) io/io_unix$(O) io/io_win32$(O) \
io/io_stdio$(O)
INTERP_O_FILES = exceptions$(O) global_setup$(O) interpreter$(O) parrot$(O) \
register$(O) core_ops$(O) core_ops_prederef$(O) memory$(O) \
packfile$(O) stacks$(O) string$(O) sub$(O) encoding$(O) \
chartype$(O) runops_cores$(O) trace$(O) pmc$(O) key$(O) hash$(O) \
platform$(O) ${jit_o} resources$(O) rx$(O) rxstacks$(O) \
embed$(O) warnings$(O) misc$(O) ${cg_o} \
packout$(O) byteorder$(O) debug$(O) smallobject$(O) \
headers$(O) dod$(O) method_util$(O)
O_FILES = $(INTERP_O_FILES) \
$(IO_O_FILES) \
$(CLASS_O_FILES) \
$(ENCODING_O_FILES) \
$(CHARTYPE_O_FILES)
OPS_FILES = ${ops} $(GEN_OPSFILES)
###############################################################################
#
# BUILD TOOL CONFIGURATIONS:
#
# DO NOT ADD C COMPILER FLAGS HERE
# Add them in Configure.pl--look for the
# comment 'ADD C COMPILER FLAGS HERE'
#
###############################################################################
CFLAGS = ${ccflags} ${cc_warn} ${cc_inc} ${cc_hasjit} ${cg_flag}
LDFLAGS = ${ldflags}
C_LIBS = ${libs}
CC = ${cc}
PERL = ${perl}
###############################################################################
#
# BUILD TARGET CONFIGURATIONS:
#
###############################################################################
TEST_PROG = ${test_prog}${exe}
TEST_PROG_SO = ${test_prog}_so${exe}
PDUMP = pdump${exe}
LINT = lclint
# note: +distinctinternalnames with +externalnamelen at 8 characters
# (the ANSI standard) is not going to fly for us.
LINTFLAGS = -weak +showscan +showsummary +posixstrictlib -abstract +aliasunique +ansireserved +ansireservedinternal +assignexpose +bitwisesigned +boolcompare +booltype BOOLVAL +casebreak -castfcnptr -charint +continuecomment +controlnestdepth 15 +cppnames +declundef +distinctinternalnames +evalorder +fielduse +forcehints -globs +imptype +includenest 8 +incondefs +incondefslib +linelen 9999 +longintegral +macroassign +macroempty +macroredef +matchanyintegral +nestedextern +noeffect +readonlystrings +realcompare +shadow -type
LINTFLAGS2 = $(LINTFLAGS) -ansireserved -retvalother
###############################################################################
#
# MAKE CONFIGURATION:
#
###############################################################################
#
# This is set to MAKE=$make if your $make command doesn't
# do it for you.
#
${make_set_make}
.c$(O) :
$(CC) $(CFLAGS) ${cc_o_out}$@ -c $<
all : $(TEST_PROG) docs
mops : examples/assembly/mops${exe} examples/mops/mops${exe}
$(TEST_PROG) : test_main$(O) $(GEN_HEADERS) $(O_DIRS) $(O_FILES) lib/Parrot/OpLib/core.pm lib/Parrot/PMC.pm
$(LD) ${ld_out}$(TEST_PROG) $(LDFLAGS) $(O_FILES) test_main$(O) $(C_LIBS)
lib_deps_object : $(O_DIRS) $(O_FILES)
$(PERL) tools/dev/lib_deps.pl object $(O_FILES)
lib_deps_source : $(GENERAL_H_FILES)
$(PERL) tools/dev/lib_deps.pl source all_source
lib_deps : lib_deps_object lib_deps_source
check_source : $(GENERAL_H_FILES)
$(PERL) tools/dev/check_source_standards.pl all_source
###############################################################################
#
# Shared Library Targets:
#
###############################################################################
blib :
-mkdir blib
blib/lib : blib
-mkdir blib${slash}lib
shared : blib/lib blib/lib/libparrot$(SO) ${blib_lib_libparrot_a} $(TEST_PROG_SO)
# XXX Unix-only for now
blib/lib/libparrot$(A) : blib/lib $(O_DIRS) $(O_FILES)
$(AR_CR) $@ $(O_FILES)
$(RANLIB) $@
blib/lib/libparrot$(SO) : blib/lib $(O_DIRS) $(O_FILES)
$(LD) $(LD_SHARED) $(LD_SHARED_FLAGS) $(LDFLAGS) $(LD_OUT)blib/lib/libparrot$(SO) $(O_FILES) $(C_LIBS)
$(TEST_PROG_SO) : test_main$(O) blib/lib/libparrot$(SO) lib/Parrot/OpLib/core.pm lib/Parrot/PMC.pm
$(LD) $(LDFLAGS) $(LD_OUT)$(TEST_PROG) test_main$(O) blib/lib/libparrot$(A) $(C_LIBS)
# XXX The dependancies on SO.MAJOR.MINOR and SO.VERSION are removed
# because those should be done at "make install" and not "make shared"
# It also makes the task of getting this working on win32 much easier. :)
#
#blib/lib/libparrot$(SO).${VERSION} : blib/lib $(O_DIRS) $(O_FILES)
# $(LD) $(LD_SHARED) -Wl,-soname,libparrot$(SO).${MAJOR} $(LDFLAGS) $(LD_OUT)blib/lib/libparrot$(SO).${VERSION} $(O_FILES)
#
#blib/lib/libparrot$(SO).${MAJOR}.${MINOR} : blib/lib/libparrot$(SO).${VERSION}
# $(RM_F) $@
# cd blib/lib; ln -s libparrot$(SO).${VERSION} libparrot$(SO).${MAJOR}.${MINOR}
#
#blib/lib/libparrot$(SO).${MAJOR} : blib/lib/libparrot$(SO).${MAJOR}.${MINOR}
# $(RM_F) $@
# cd blib/lib; ln -s libparrot$(SO).${MAJOR}.${MINOR} libparrot$(SO).${MAJOR}
#
#blib/lib/libparrot$(SO) : blib/lib/libparrot$(SO).${MAJOR}
# $(RM_F) $@
# cd blib/lib; ln -s libparrot$(SO).${MAJOR} libparrot$(SO)
#
#blib/lib/libcore_prederef$(SO).${VERSION} : blib/lib core_ops_prederef$(O)
# $(LD) $(LD_SHARED) -Wl,-soname,libparrot$(SO).${MAJOR} $(LDFLAGS) $(LD_OUT)blib/lib/libcore_prederef$(SO).${VERSION} core_ops_prederef$(O)
#
#blib/lib/libcore_prederef$(SO).${MAJOR}.${MINOR} : blib/lib/libcore_prederef$(SO).${VERSION}
# $(RM_F) $@
# cd blib/lib; ln -s libcore_prederef$(SO).${VERSION} libcore_prederef$(SO).${MAJOR}.${MINOR}
#
#blib/lib/libcore_prederef$(SO).${MAJOR} : blib/lib/libcore_prederef$(SO).${MAJOR}.${MINOR}
# $(RM_F) $@
# cd blib/lib; ln -s libcore_prederef$(SO).${MAJOR}.${MINOR} libcore_prederef$(SO).${MAJOR}
#
#blib/lib/libcore_prederef$(SO) : blib/lib/libcore_prederef$(SO).${MAJOR}
# $(RM_F) $@
# cd blib/lib; ln -s libcore_prederef$(SO).${MAJOR} libcore_prederef$(SO)
#
# Parrot Debugger
#
PDB=pdb
pdb$(O) : $(GENERAL_H_FILES)
$(PDB) : pdb$(O) $(O_DIRS) $(O_FILES)
$(LD) ${ld_out}$(PDB) pdb$(O) $(O_FILES) $(C_LIBS) $(LDFLAGS)
#
# Parrot Disassembler
#
DIS=disassemble
disassemble$(O) : $(GENERAL_H_FILES)
$(DIS) : disassemble$(O) $(O_DIRS) $(O_FILES)
$(LD) ${ld_out}$(DIS) disassemble$(O) $(O_FILES) $(C_LIBS) $(LDFLAGS)
#
# Parrot Dump
#
#$(PDUMP) : pdump$(O) packfile$(O)
# $(LD) ${ld_out}$(PDUMP) pdump$(O) packfile$(O) string$(O) chartype$(O) memory$(O) $(C_LIBS) $(LDFLAGS)
###############################################################################
#
# Other Dependencies and Build Rules:
#
###############################################################################
test_main$(O) : test_main.c $(GENERAL_H_FILES)
lib/Parrot/OpLib/core.pm : $(OPS_FILES) ops2pm.pl lib/Parrot/OpsFile.pm lib/Parrot/Op.pm
$(PERL) ops2pm.pl $(OPS_FILES)
lib/Parrot/PMC.pm : include/parrot/pmc.h pmc_pm.pl
$(PERL) pmc_pm.pl
###############################################################################
#
# Examples (Assembly):
#
###############################################################################
examples/assembly/mops.pbc : examples/assembly/mops.pasm assemble.pl
cd examples && cd assembly && $(MAKE) mops.pbc PERL=$(PERL) && cd .. && cd ..
examples/assembly/mops.c : examples/assembly/mops.pbc pbc2c.pl
$(PERL) pbc2c.pl examples/assembly/mops.pbc > examples/assembly/mops.c
examples/assembly/mops${exe} : examples/assembly/mops$(O) $(O_DIRS) $(O_FILES)
$(LD) $(LDFLAGS) ${ld_out}examples/assembly/mops${exe} examples/assembly/mops$(O) $(O_FILES) $(C_LIBS)
examples/assembly/life.pbc : examples/assembly/life.pasm assemble.pl
cd examples && cd assembly && $(MAKE) life.pbc PERL=$(PERL) && cd .. && cd ..
examples/assembly/life.c : examples/assembly/life.pbc pbc2c.pl
$(PERL) pbc2c.pl examples/assembly/life.pbc > examples/assembly/life.c
examples/assembly/life${exe} : examples/assembly/life$(O) $(O_DIRS) $(O_FILES)
$(LD) $(LDFLAGS) ${ld_out}examples/assembly/life${exe} examples/assembly/life$(O) $(O_FILES) $(C_LIBS)
###############################################################################
#
# Examples (MOPS) - Comparative:
#
###############################################################################
examples/mops/mops$(O) : examples/mops/mops.c
examples/mops/mops${exe} : examples/mops/mops$(O) platform$(O)
$(LD) $(LDFLAGS) ${ld_out}examples/mops/mops${exe} examples/mops/mops$(O) platform$(O) $(C_LIBS)
###############################################################################
#
# Dependencies:
#
###############################################################################
global_setup$(O) : $(GENERAL_H_FILES)
pmc$(O) : $(GENERAL_H_FILES)
hash$(O) : $(GENERAL_H_FILES)
jit$(O) : $(GENERAL_H_FILES) ${jit_h} $(INC)/jit_emit.h
jit_cpu$(O): $(GENERAL_H_FILES) ${jit_h} $(INC)/jit_emit.h
key$(O) : $(GENERAL_H_FILES)
smallobject$(O) : $(GENERAL_H_FILES)
headers$(O) : $(GENERAL_H_FILES)
dod$(O) : $(GENERAL_H_FILES)
resources$(O) : $(GENERAL_H_FILES)
platform$(O) : $(GENERAL_H_FILES)
debug$(O) : $(GENERAL_H_FILES) $(INC)/debug.h
method_util$(O) : $(GENERAL_H_FILES)
string$(O) : $(GENERAL_H_FILES)
chartype$(O) : $(GENERAL_H_FILES)
encoding$(O) : $(GENERAL_H_FILES)
chartype/usascii$(O) : $(GENERAL_H_FILES)
chartype/unicode$(O) : $(GENERAL_H_FILES)
exceptions$(O) : $(GENERAL_H_FILES)
encoding/singlebyte$(O) : $(GENERAL_H_FILES)
encoding/utf8$(O) : $(GENERAL_H_FILES)
encoding/utf16$(O) : $(GENERAL_H_FILES)
encoding/utf32$(O) : $(GENERAL_H_FILES)
interpreter$(O) : interpreter.c $(GENERAL_H_FILES) ${jit_h}
io/io$(O) : $(GENERAL_H_FILES)
io/io_buf$(O) : $(GENERAL_H_FILES)
io/io_unix$(O) : $(GENERAL_H_FILES)
io/io_win32$(O) : $(GENERAL_H_FILES)
io/io_stdio$(O) : $(GENERAL_H_FILES)
memory$(O) : $(GENERAL_H_FILES)
packfile$(O) : $(GENERAL_H_FILES)
packout$(O) : $(GENERAL_H_FILES)
parrot$(O) : $(GENERAL_H_FILES)
register$(O) : $(GENERAL_H_FILES)
rx$(O) : $(GENERAL_H_FILES)
rxstacks$(O) : $(GENERAL_H_FILES)
stacks$(O) : $(GENERAL_H_FILES)
embed$(O) : $(GENERAL_H_FILES) $(INC)/debug.h
core_ops$(O) : $(GENERAL_H_FILES) core_ops.c
#core_ops depends upon config.h so that it gets updated along with updates to config.h's version numbers
core_ops.c $(INC)/oplib/core_ops.h : $(OPS_FILES) ops2c.pl lib/Parrot/OpsFile.pm lib/Parrot/Op.pm $(INC)/config.h
$(PERL) ops2c.pl C $(OPS_FILES)
core_ops_prederef$(O) : $(GENERAL_H_FILES) core_ops_prederef.c
core_ops_prederef.c $(INC)/oplib/core_ops_prederef.h : $(OPS_FILES) ops2c.pl lib/Parrot/OpsFile.pm lib/Parrot/Op.pm $(INC)/config.h
$(PERL) ops2c.pl CPrederef $(OPS_FILES)
${cg_c}
warnings$(O) : $(H_FILES)
misc$(O) : $(H_FILES)
$(STICKY_FILES) : Configure.pl
$(PERL) Configure.pl
$(INC)/vtable.h : vtable.tbl vtable_h.pl
$(PERL) vtable_h.pl
$(INC)/jit_emit.h: jit/${jitcpuarch}/jit_emit.h
$(PERL) -MFile::Copy=cp -e ${PQ}cp q|jit/${jitcpuarch}/jit_emit.h|, q|$(INC)/jit_emit.h|${PQ}
jit_cpu.c: lib/Parrot/OpLib/core.pm $(INC)/jit_emit.h jit/${jitcpuarch}/core.jit
$(PERL) jit2h.pl ${jitcpuarch} jit_cpu.c
docs : docs/.dummy
#newasm : $(TEST_PROG) lib/Parrot/.dummy
docs/.dummy :
cd docs && $(MAKE) && cd ..
classes : classes/.dummy
classes/.dummy :
cd classes && $(MAKE) && cd ..
languages : languages.dummy
languages.dummy :
cd languages && $(MAKE) && cd ..
###############################################################################
#
# Testing Targets:
#
###############################################################################
test : $(TEST_PROG) ${blib_lib_libparrot_a} assemble.pl test_dummy
test_dummy :
$(PERL) t/harness $(TEST_PROG_ARGS)
testp : $(TEST_PROG) assemble.pl blib/lib/libcore_prederef$(SO) blib/lib/libparrot$(SO) $(TEST_PROG_SO) test_dummy_p
test_dummy_p :
$(PERL) t/harness $(TEST_PROG_ARGS) -P
testj : $(TEST_PROG) assemble.pl test_dummy_j
test_dummy_j :
$(PERL) t/harness $(TEST_PROG_ARGS) -j
quicktest : $(TEST_PROG) assemble.pl quicktest_dummy
quicktest_dummy :
$(PERL) t/harness $(TEST_PROG_ARGS) quick
mopstest : $(TEST_PROG) examples/assembly/mops.pbc
$(TEST_PROG) $(TEST_PROG_ARGS) examples/assembly/mops.pbc
lifetest : $(TEST_PROG) examples/assembly/life.pbc
$(TEST_PROG) $(TEST_PROG_ARGS) examples/assembly/life.pbc
###############################################################################
#
# Cleaning Targets:
#
###############################################################################
clean : testclean
${cg_r}
$(RM_F) $(O_FILES)
$(RM_F) *.s
$(RM_F) $(FLUID_FILES)
$(RM_F) $(TEST_PROG) test_main$(O) $(PDUMP) pdump$(O)
$(RM_F) examples/assembly/mops${exe} examples/assembly/mops.c
$(RM_F) examples/assembly/mops$(O) examples/assembly/mops.pbc
$(RM_F) examples/mops/mops$(O) examples/mops/mops${exe}
$(RM_RF) blib
$(RM_F) *~
cd docs && $(MAKE) clean && cd ..
cd classes && $(MAKE) clean && cd ..
cd languages && $(MAKE) clean && cd ..
testclean :
$(RM_F) t/op/*.pasm t/op/*.pbc t/op/*.out
$(RM_F) t/pmc/*.pasm t/pmc/*.pbc t/pmc/*.out
realclean : clean
$(RM_F) $(STICKY_FILES)
distclean :
$(PERL) "-MExtUtils::Manifest=filecheck" -le ${PQ}sub ExtUtils::Manifest::_maniskip{sub{0}};$$ExtUtils::Manifest::Quiet=1;unlink $$_ for filecheck()${PQ}
cvsclean :
$(PERL) "-MExtUtils::Manifest=filecheck" -le ${PQ}sub ExtUtils::Manifest::_maniskip{sub{0}};$$ExtUtils::Manifest::Quiet=1; do { unlink $$_ unless $$_ =~ m!(?:CVS/|\.cvs)! } for filecheck()${PQ}
reconfig :
$(MAKE) clean; $(PERL) Configure.pl --reconfig
manitest :
$(PERL) "-MExtUtils::Manifest=fullcheck" -e fullcheck
###############################################################################
#
# CVS Targets:
#
###############################################################################
update :
cvs -q update -dP
status :
cvs -n -q upd -dP
lint : ${test_prog}
$(LINT) ${cc_inc} ${cc_hasjit} "-Iclasses" $(LINTFLAGS) `echo $(O_FILES) | sed 's/\.o/\.c/g'`
$(LINT) ${cc_inc} $(LINTFLAGS) test_main.c
lint2 : ${test_prog}
$(LINT) ${cc_inc} ${cc_hasjit} "-Iclasses" $(LINTFLAGS2) `echo $(O_FILES) | sed 's/\.o/\.c/g'`
$(LINT) ${cc_inc} $(LINTFLAGS2) test_main.c
Jump to Line
Something went wrong with that request. Please try again.