Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Build the PMCs from src/pmc/Makefile
  • Loading branch information
bschmalhofer committed Mar 1, 2009
1 parent 06fe934 commit 1ff3993
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 53 deletions.
54 changes: 3 additions & 51 deletions build/templates/Makefile.in
Expand Up @@ -18,41 +18,11 @@ MAKE = @make_c@
PARROT = $(BUILD_DIR)/parrot@exe@
PERL = @perl@
RM_F = @rm_f@
PMCBUILD = $(PERL) @build_dir@/tools/build/dynpmc.pl
NQP = $(BUILD_DIR)/compilers/nqp/nqp.pbc
PCT = $(BUILD_DIR)/runtime/parrot/library/PCT.pbc
PBC_TO_EXE = $(BUILD_DIR)/pbc_to_exe$(EXE)
CC = @cc@
#copy/pasta from CFLAGS in config/gen/makefiles/dynpmc_pl.in
CFLAGS = @ccflags@ @cc_shared@ @cc_debug@ @ccwarn@ @cc_hasjit@ @cg_flag@ @gc_flag@
TOUCH = @touch@

PMCS = \
php \
phparray \
phpboolean \
phpfloat \
phpinteger \
phpresource \
phpstring \
phpnull

PMC_SOURCES = \
$(PMC_DIR)/php.pmc \
$(PMC_DIR)/phparray.pmc \
$(PMC_DIR)/phpboolean.pmc \
$(PMC_DIR)/phpfloat.pmc \
$(PMC_DIR)/phpinteger.pmc \
$(PMC_DIR)/phpresource.pmc \
$(PMC_DIR)/phpstring.pmc \
$(PMC_DIR)/phpnull.pmc

HASH_SOURCES = $(PMC_DIR)/pipp_hash.c
HASH_H = $(PMC_DIR)/pipp_hash.h
HASH_OBJS = $(PMC_DIR)/pipp_hash$(O)

PHP_GROUP = $(PMC_DIR)/php_group$(LOAD_EXT)

INTERNALS_PIR = \
src/classes/Object.pir

Expand Down Expand Up @@ -135,7 +105,6 @@ help:
@echo " test: Run the test suite for Pipp."
@echo " test-all: Run the test suite for reference implementation and for Pipp."
@echo " test-php: Run the test suite for the reference implementation."
@echo " test-pmc: Run the test suite for Pipp's PMCs."
@echo " smoke: Run the test suite and send report to the smolder server"
@echo " codetest: Run file metadata and coding standards tests."
@echo ""
Expand Down Expand Up @@ -200,27 +169,13 @@ Test.pir: Test.php pipp.pbc
$(PARROT) pipp.pbc --target=pir --output=Test.pir Test.php


build-pmc: $(HASH_OBJS) $(PHP_GROUP)

#Any change to the hash code means phparray needs to be relinked too.
#Recompiling is close enough for now.
$(HASH_OBJS): $(HASH_SOURCES) $(HASH_H)
$(TOUCH) $(PMC_DIR)/phparray.pmc
$(CC) $(CFLAGS) -I$(INCLUDE_DIR) $(HASH_SOURCES) -c -g -o $(HASH_OBJS)

export DYNPMC_INCLUDE=$(BUILD_DIR)/languages/pipp
export DYNPMC_LINK=$(BUILD_DIR)/languages/pipp/$(HASH_OBJS)

$(PHP_GROUP): $(PMC_SOURCES)
@cd $(PMC_DIR) && $(PMCBUILD) generate $(PMCS)
@cd $(PMC_DIR) && $(PMCBUILD) compile $(PMCS)
@cd $(PMC_DIR) && $(PMCBUILD) linklibs $(PMCS)
@cd $(PMC_DIR) && $(PMCBUILD) copy "--destination=$(PARROT_DYNEXT)" $(PMCS)
build-pmc:
$(MAKE) $(PMC_DIR) build

test: all
- $(PERL) t/harness

test-all: all test-php test test-pmc
test-all: all test-php test

test-php:
- $(PERL) t/harness --with-php
Expand All @@ -234,9 +189,6 @@ smoke : build
# make sure debugging output is disabled while running the tests
export PMCDEBUG=

test-pmc: build-pmc
@ prove -I../../lib t/pmc

# this does not work yet
test-pcc-testsuite: all t/pcc-testsuite
cd t/pcc-testsuite && svn up
Expand Down
63 changes: 61 additions & 2 deletions build/templates/src/pmc/Makefile.in
Expand Up @@ -3,17 +3,61 @@
# Set up commands
PERL = @perl@
RM_F = @rm_f@
TOUCH = @touch@
PMCBUILD = $(PERL) @build_dir@/tools/build/dynpmc.pl
CC = @cc@
CFLAGS = @ccflags@ @cc_shared@ @cc_debug@ @ccwarn@ @cc_hasjit@ @cg_flag@ @gc_flag@

# Set up directories
BUILD_DIR = @build_dir@
PMC_DIR = src/pmc
INCLUDE_DIR = $(BUILD_DIR)/include
PARROT_DYNEXT = $(BUILD_DIR)/runtime/parrot/dynext

# Set up extensions
LOAD_EXT = @load_ext@
O = @o@


HASH_SOURCES = pipp_hash.c
HASH_H = pipp_hash.h
HASH_OBJS = pipp_hash$(O)

PHP_GROUP = $(PMC_DIR)/php_group$(LOAD_EXT)

PMC_SOURCES = \
php.pmc \
phparray.pmc \
phpboolean.pmc \
phpfloat.pmc \
phpinteger.pmc \
phpresource.pmc \
phpstring.pmc \
phpnull.pmc

PMCS = \
php \
phparray \
phpboolean \
phpfloat \
phpinteger \
phpresource \
phpstring \
phpnull

PMC_SOURCES = \
php.pmc \
phparray.pmc \
phpboolean.pmc \
phpfloat.pmc \
phpinteger.pmc \
phpresource.pmc \
phpstring.pmc \
phpnull.pmc


# default
build:
@echo "Not yet implemented"
build: $(HASH_OBJS) $(PHP_GROUP)


# This is a listing of all targets, that are meant to be called by users
Expand All @@ -29,6 +73,21 @@ help:
@echo " clean: Clean up."
@echo ""

#Any change to the hash code means phparray needs to be relinked too.
#Recompiling is close enough for now.
$(HASH_OBJS): $(HASH_SOURCES) $(HASH_H)
$(TOUCH) phparray.pmc
$(CC) $(CFLAGS) -I$(INCLUDE_DIR) $(HASH_SOURCES) -c -g -o $(HASH_OBJS)

export DYNPMC_INCLUDE=$(BUILD_DIR)/languages/pipp
export DYNPMC_LINK=$(BUILD_DIR)/languages/pipp/src/pmc/$(HASH_OBJS)

$(PHP_GROUP): $(PMC_SOURCES)
@$(PMCBUILD) generate $(PMCS)
@$(PMCBUILD) compile $(PMCS)
@$(PMCBUILD) linklibs $(PMCS)
@$(PMCBUILD) copy "--destination=$(PARROT_DYNEXT)" $(PMCS)

# cleaning up
clean:
$(RM_F) "*dump" "php*.c" "pmc_*h" "php_group.h" "*$(O)" "*$(LOAD_EXT)"
Expand Down

0 comments on commit 1ff3993

Please sign in to comment.