Commit 051dd586 authored by Clemens Grelck's avatar Clemens Grelck
Browse files

repository done

parent 190c823f
......@@ -2,7 +2,6 @@
#
# $Id$
#
#
###############################################################################
......@@ -10,14 +9,17 @@
# Calling conventions:
#
# Start rules:
# devel compile developer code (default)
# prod compile product code
# efence compile efence debugging code
# clean cleanup derived files
# default compile executables as developer code and libraries as product
# code
# devel compile everything as developer code
# prod compile everything as product code
# clean cleanup all derived files
# cleandevel cleanup only compiled files (developer code)
# cleanprod cleanup only compiled files (product code)
#
# Parameters:
# CHECK_DEPS="no" de-activate dependency checking meachanism
# HIDE="" show important commands issued by make (debugging)
# DEPS="no" de-activate dependency checking meachanism
# HIDE="" show important commands issued by make (debugging)
#
###############################################################################
......@@ -30,155 +32,116 @@
PROJECT_ROOT := .
HIDE := @
CHECK_DEPS := yes
include $(PROJECT_ROOT)/Makefile.Config
include $(PROJECT_ROOT)/Makefile.Targets
DEPS := yes
ALL_SOURCE_DIRS := $(addprefix src/,$(src))
SOURCE_MAKEFILES := $(addsuffix /Makefile,$(ALL_SOURCE_DIRS))
include $(PROJECT_ROOT)/src/makefiles/config.mkf
###############################################################################
#
# Dummy rules
#
.PHONY: clean %.clean cleanprod %.cleanprod all devel prod %.track
.PHONY: efence check_os maketools makefiles libsac libsac2c heapmgr
.PHONY: distrib ctags runtime tools lib makesubdir xml
.PRECIOUS: %.c %.h %.o %.prod.o .%.d %.c %.mac %.lex.c %.tab.c %.tab.h
.PHONY: default devel prod clean cleandevel cleanprod efence config
###############################################################################
#
# Start rules
#
all: devel
devel: check_os lib maketools makefiles xml make_sac2c libsac heapmgr runtime tools
prod: check_os lib maketools makefiles xml make_sac2c.prod libsac heapmgr runtime tools
efence: check_os lib maketools makefiles xml make_sac2c.efence libsac heapmgr runtime tools
###############################################################################
# The definition of these rules deliberately enforces a sequence in compilation
# rather than expressing the dependencies properly by makefile rules.
#
# Auxiliary rules
# The rationale is that commonlib and maketools rather seldomly require
# recompilation. With proper dependencies, however, they would require a
# dependency from every compilation rule. This would lead to extensive
# rechecking at compile time that is absolutely superfluous.
#
# The runtime system may require the compiler and, likewise, the tools may
# need the runtime system or parts thereof. Expressing all this by dependencies
# would lead to a system in which the tools form the main target. This seems
# unnatural.
#
# Furthermore, the current solution allows us to rebuild locally without
# enforcing dependency checks.
#
check_os:
@ if [ "$(OS)" = "" -o "$(ARCH)" = "" ]; \
then $(ECHO) "*** Unknown OS or unknown ARCH! Please specify!"; \
exit 1; \
fi
@ $(ECHO)
@ $(ECHO) "Building for $(OS) on $(ARCH).";
maketools:
$(MAKE) -C tools
makefiles: $(SOURCE_MAKEFILES)
xml:
$(MAKE) -C src/xml
src/%/Makefile: Makefile.Source
@$(ECHO) "Creating makefile: $@"
@cp -f $< $@
make_%:
default devel prod: checks
@$(ECHO) ""
@$(ECHO) "************************************************************"
@$(ECHO) "* Building $(PROJECT_NAME)"
@$(ECHO) "************************************************************"
$(HIDE) $(MAKE) -C src/commonlib DEPS="$(DEPS)" HIDE="$(HIDE)" \
PREFIX_LOCAL="src/commonlib/" PREFIX_ROOT="" $@
$(HIDE) $(MAKE) -C src/maketools DEPS="$(DEPS)" HIDE="$(HIDE)" \
PREFIX_LOCAL="src/maketools/" PREFIX_ROOT="" $@
$(HIDE) $(MAKE) -C src/libsac2c DEPS="$(DEPS)" HIDE="$(HIDE)" \
PREFIX_LOCAL="src/libsac2c/" PREFIX_ROOT="" $@
$(HIDE) $(MAKE) -C src/runtime DEPS="$(DEPS)" HIDE="$(HIDE)" \
PREFIX_LOCAL="src/runtime/" PREFIX_ROOT="" $@
$(HIDE) $(MAKE) -C src/libsacprelude DEPS="$(DEPS)" HIDE="$(HIDE)" \
PREFIX_LOCAL="src/libsacprelude/" PREFIX_ROOT="" $@
$(HIDE) $(MAKE) -C src/libsac DEPS="$(DEPS)" HIDE="$(HIDE)" \
PREFIX_LOCAL="src/libsac/" PREFIX_ROOT="" $@
$(HIDE) $(MAKE) -C src/libsacphm DEPS="$(DEPS)" HIDE="$(HIDE)" \
PREFIX_LOCAL="src/libsacphm/" PREFIX_ROOT="" $@
$(HIDE) $(MAKE) -C src/tools DEPS="$(DEPS)" HIDE="$(HIDE)" \
PREFIX_LOCAL="src/tools/" PREFIX_ROOT="" $@
@$(ECHO) ""
@$(ECHO) "************************************************************"
@$(ECHO) "* Building $(PROJECT_NAME) completed"
@$(ECHO) "************************************************************"
@$(ECHO) ""
clean cleandevel cleanprod:
@$(ECHO) ""
@$(ECHO) "************************************************************"
@$(ECHO) "* Cleaning $(PROJECT_NAME)"
@$(ECHO) "************************************************************"
$(HIDE) $(MAKE) -C src/commonlib DEPS="$(DEPS)" HIDE="$(HIDE)" \
PREFIX_LOCAL="src/commonlib/" PREFIX_ROOT="" $@
$(HIDE) $(MAKE) -C src/maketools DEPS="$(DEPS)" HIDE="$(HIDE)" \
PREFIX_LOCAL="src/maketools/" PREFIX_ROOT="" $@
$(HIDE) $(MAKE) -C src/libsac2c DEPS="$(DEPS)" HIDE="$(HIDE)" \
PREFIX_LOCAL="src/libsac2c/" PREFIX_ROOT="" $@
$(HIDE) $(MAKE) -C src/runtime DEPS="$(DEPS)" HIDE="$(HIDE)" \
PREFIX_LOCAL="src/runtime/" PREFIX_ROOT="" $@
$(HIDE) $(MAKE) -C src/libsacprelude DEPS="$(DEPS)" HIDE="$(HIDE)" \
PREFIX_LOCAL="src/libsacprelude/" PREFIX_ROOT="" $@
$(HIDE) $(MAKE) -C src/libsac DEPS="$(DEPS)" HIDE="$(HIDE)" \
PREFIX_LOCAL="src/libsac/" PREFIX_ROOT="" $@
$(HIDE) $(MAKE) -C src/libsacphm DEPS="$(DEPS)" HIDE="$(HIDE)" \
PREFIX_LOCAL="src/libsacphm/" PREFIX_ROOT="" $@
$(HIDE) $(MAKE) -C src/tools DEPS="$(DEPS)" HIDE="$(HIDE)" \
PREFIX_LOCAL="src/tools/" PREFIX_ROOT="" $@
@$(ECHO) ""
@$(ECHO) "************************************************************"
@$(ECHO) "* Cleaning $(PROJECT_NAME) completed"
@$(ECHO) "************************************************************"
@$(ECHO) ""
@$(ECHO) "************************************"
@$(ECHO) "* Making $*"
@$(ECHO) "************************************"
@touch make_track
@$(MAKE) -f Makefile.Sac2c CHECK_DEPS="$(CHECK_DEPS)" \
HIDE="$(HIDE)" TARGET="$(src)" $*
doxygen:
doxygen sac2cdoxy
efence:
$(HIDE) $(MAKE) -C src/compiler DEPS="$(DEPS)" HIDE="$(HIDE)" $@
###############################################################################
#
# Rules for cleaning directories
# Rules for configure mechanism
#
clean: makefiles $(addsuffix .clean,$(ALL_SOURCE_DIRS))
$(RM) sac2c
$(RM) sac2c.prod
$(RM) sac2c.efence
$(RM) -r .sb SunWS_cache
$(RM) src.tar.gz src/global/build.c
$(MAKE) -C tools clean
$(MAKE) -C src/libsac clean
$(MAKE) -C src/heapmgr clean
$(MAKE) -C src/runtime clean
$(MAKE) -C src/tools clean
%.clean:
@$(ECHO) "Cleaning directory $*"
@$(MAKE) -C $* clean
cleanprod: $(addsuffix .cleanprod,$(ALL_SOURCE_DIRS))
%.cleanprod:
@$(ECHO) "Cleaning directory $* (product sources)"
@$(MAKE) -C $* cleanprod
config:
svn lock configure $(AUTOHEADERED)
autoconf
autoheader
svn commit configure $(AUTOHEADERED)
###############################################################################
#
# Rules for old style recursive make invocations for non-sac2c stuff
# Rules for consistency checks
#
lib:
$(MAKE) CHECK_DEPS="no" -C lib/src
libsac:
$(MAKE) CHECK_DEPS="no" -C src/libsac
heapmgr:
ifneq ($(DISABLE_PHM),yes)
$(MAKE) CHECK_DEPS="no" -C src/heapmgr
endif
runtime:
$(MAKE) CHECK_DEPS="no" -C src/runtime
tools:
$(MAKE) CHECK_DEPS="no" -C src/tools
libsac2c:
$(MAKE) -C src/libsac libsac2c.so
distrib:
(cd distrib/src; $(MAKE))
ctags:
ctags src/*/*.[ch] >/dev/null
$(PROJECT_ROOT)/Makefile.Config: $(PROJECT_ROOT)/Makefile.Config.in
(cd $(PROJECT_ROOT); ./configure)
configure: configure.ac
svn lock configure src/global/config.h.in
autoconf
autoheader
svn commit configure src/global/config.h.in
include $(PROJECT_ROOT)/src/makefiles/check.mkf
This diff is collapsed.
......@@ -7,7 +7,7 @@ dnl on different hosts and os
dnl tell configure who we are
dnl parameters: package name, version, where to send bugreports
AC_INIT(sac2c, rcs, info@sac-home.org)
AC_INIT(sac2c, svn, info@sac-home.org)
dnl set source directory and scripting directory
AC_CONFIG_SRCDIR(.)
......@@ -17,8 +17,8 @@ dnl we use C as our compiler language
AC_LANG(C)
dnl and which files to create
AC_CONFIG_FILES(Makefile.Config src/runtime/sac2crc)
AC_CONFIG_HEADER(./src/global/config.h)
AC_CONFIG_FILES(src/makefiles/config.mkf include/sac2crc)
AC_CONFIG_HEADER(src/include/config.h)
dnl check for host type
AC_CANONICAL_BUILD()
......@@ -118,7 +118,7 @@ case "$GNUINDENT" in
AC_MSG_RESULT(yes)
;;
*)
CB="\$(PROJECT_ROOT)/tools/bin/cb"
CB="\$(PROJECT_ROOT)/src/bin/cb"
AC_MSG_RESULT(no)
;;
esac
......@@ -133,7 +133,7 @@ if [ test "$YACC" != "yacc" ]; then
AC_MSG_CHECKING([whether $YACC works])
mkdir .ac_yacc_test
cd .ac_yacc_test
cp ../src/scanparse/sac.y .
cp ../src/libsac2c/scanparse/sac.y .
if [ $YACC sac.y >/dev/null 2>/dev/null ]; then
AC_MSG_RESULT(ok)
else
......@@ -416,6 +416,7 @@ AC_DEFINE( PF_MAXFUNAP, 100,
AC_DEFINE( PF_MAXFUNNAMELEN, 100,
[set to maximum length of sac function names for profiling])
AC_DEFINE( SAC_PRELUDE_NAME, "sacprelude", [name of sac prelude])
dnl generate the Makefile.Config out of Makefile.Config.in
......
......@@ -20,8 +20,8 @@ target default:
CC := "@CC@"
CCFLAGS := "@RCCCFLAGS@"
CCDIR := "-I$SACBASE/runtime/ "
"-L$SACBASE/runtime/"
CCDIR := "-I$SAC2CBASE/include/ "
"-L$SAC2CBASE/lib/"
LDFLAGS := "@RCLDFLAGS@"
CCLINK := ""
CCMTLINK := "@CCMTLINK@"
......
#
# $Id$
#
#######################################################################################
#
# include general setup:
#
PROJECT_ROOT := ../..
include $(PROJECT_ROOT)/Makefile.Config
#######################################################################################
#
# local settings:
#
INCS= -I../../inc -I../../src/global
all: ../dbug.o ../getoptions.o ../md5.o
../dbug.o: dbug.c
$(CC) $(CFLAGS) $(CCFLAGS) -o ../dbug.o -c dbug.c $(INCS)
../getoptions.o: getoptions.c
$(CC) $(CFLAGS) $(CCFLAGS) -o ../getoptions.o -c getoptions.c $(INCS)
../md5.o: md5.c
$(CC) $(CFLAGS) $(CCFLAGS) -o ../md5.o -c md5.c $(INCS)
clean:
$(RM) ../dbug.o ../getoptions.o *.bak *~ .*.d
#
#
# $Log$
# Revision 3.16 2004/11/26 20:39:10 sbs
# dependency mechanism deactivated (temporarily)
#
# Revision 3.15 2004/11/21 12:48:08 sah
# removed some old ast info
#
# Revision 3.14 2004/10/04 17:18:29 sah
# a different subset of files is compiled, depending
# on the compiler version to create
#
# Revision 3.13 2003/09/09 13:03:43 sbs
# -I../typecheck added
#
# Revision 3.12 2002/06/06 19:56:03 dkr
# target clean modified
#
# Revision 3.11 2001/11/15 15:36:48 sacbase
# CLOCK_SKEW_ELIMINATION and PROJECT_ROOT added.
#
# Revision 3.10 2001/11/14 12:59:48 sbs
# deps line replaced by inclusion of Makefile.Deps
# ( .xxx.d mechanism)
# global setup included via Makefile.Config
#
# Revision 3.9 2001/11/13 20:32:51 dkr
# make deps done
#
# Revision 3.8 2001/03/22 20:20:21 dkr
# make deps done
#
# Revision 3.7 2001/03/02 16:14:07 dkr
# make deps done
#
# Revision 3.6 2001/03/02 14:55:22 sbs
# constants included rather than typecheck now.
# (shape has moved there)
#
# Revision 3.5 2001/03/02 14:46:04 sbs
# make deps done
#
# Revision 3.4 2001/03/02 10:35:53 dkr
# /home/dkr/sac/BASE/sac2c/src/c-interface/RCS/Makefile,v used in touch-rules
#
# Revision 3.3 2001/01/17 10:13:13 dkr
# make deps done
#
# Revision 3.2 2000/12/06 20:09:13 dkr
# make deps done
#
# Revision 3.1 2000/11/20 18:03:38 sacbase
# new release made
#
# Revision 1.12 2000/11/02 14:54:48 dkr
# deps made
#
# Revision 1.11 2000/11/02 14:54:34 dkr
# RCS header added
# explicit .mac dependencies added
#
#
#######################################################################################
#
# include general setup:
#
PROJECT_ROOT := ../..
include $(PROJECT_ROOT)/Makefile.Config
#######################################################################################
#
# local settings:
#
INCS = -I../global -I../tree -I../../inc -I../compile -I../modules \
-I../constants -I../print -I../scanparse -I../typecheck
OBJS :=
#OBJS := print_interface.o map_cwrapper.o import_specialization.o \
#print_interface_header.o print_interface_wrapper.o
all: $(OBJS)
#
# the *.[ch] objects are to fool makedepend which does not
# recognize the dependency between *.[ch] and the .mac files!
#
print_interface_wrapper.c: ../tree/type_info.mac
touch $@
$(CLOCK_SKEW_ELIMINATION) $@
%.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -o $@ -c $< $(INCS)
$(CLOCK_SKEW_ELIMINATION) $@
clean:
$(RM) *.o *.a *.bak *~ .*.d
$(RM) -r .sb SunWS_cache
#######################################################################################
#
# include automatic dependency mechanism
#
# - relies on INCS to be set appropriately
#
# include ../../Makefile.Deps
This diff is collapsed.
/*
*
* $Log$
* Revision 3.3 2004/11/22 11:00:05 ktr
* Ismop 2004 SacDevCamp 04
*
* Revision 3.2 2001/03/22 18:02:55 dkr
* tree.h no longer included
*
* Revision 3.1 2000/11/20 18:03:40 sacbase
* new release made
*
* Revision 1.1 2000/07/21 08:18:08 nmw
* Initial revision
*
*/
#ifndef _SAC_IMPORT_SPECIALIZATION_H_
#define _SAC_IMPORT_SPECIALIZATION_H_
#include "types.h"
/******************************************************************************
*
* Import Specialization traversal (impspec_tab)
*
* Prefix: IMPSPEC
*
*****************************************************************************/
extern node *IMPSPECdoImportSpecialization (node *syntax_tree);
extern node *IMPSPECfundef (node *arg_node, info *arg_info);
extern node *IMPSPECmodspec (node *arg_node, info *arg_info);
extern node *IMPSPECarg (node *arg_node, info *arg_info);
#endif /* _SAC_IMPORT_SPECIALIZATION_H_ */
/*
*
* $Log$
* Revision 3.6 2005/01/10 17:30:05 cg
* Removed useless #include Error.h.
*
* Revision 3.5 2004/11/23 21:49:39 cg
* brushed usage of genlib
* min_array_rep_t turned into enum type.
*
* Revision 3.4 2001/05/17 12:52:48 nmw
* MALLOC/FREE replaced by Malloc/Free, using result of Free()
*
* Revision 3.3 2001/04/27 08:46:18 nmw
* CountFunResults() counts void results no more :-)
*
* Revision 3.2 2001/03/22 18:05:35 dkr
* include of tree.h eliminated
*
* Revision 3.1 2000/11/20 18:03:40 sacbase
* new release made
*
* Revision 1.10 2000/10/31 18:19:13 cg
* Added support for new function tag ST_exported.
*
* Revision 1.9 2000/08/02 12:00:28 nmw
* phase comment removed
*
* Revision 1.8 2000/07/28 14:46:32 nmw
* handling of void functions added
*
* Revision 1.7 2000/07/14 15:56:51 nmw
* global object handling enabled
*
* Revision 1.6 2000/07/12 10:05:13 nmw
* RCS-Header added
*
* Revision 1.5 2000/07/12 09:23:59 nmw
* returntype counting modified
*
* Revision 1.4 2000/07/07 15:34:35 nmw
* counting of artificial results added
*
* Revision 1.3 2000/07/06 15:55:42 nmw
* cosmetic changes on output
*
* Revision 1.2 2000/07/06 10:07:22 nmw
* comments changed
*
* Revision 1.1 2000/07/05 11:38:19 nmw
* Initial revision
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "types.h"
#include "tree_basic.h"
#include "tree_compound.h"
#include "internal_lib.h"
#include "map_cwrapper.h"
#include "my_debug.h"
#include "dbug.h"
#include "traverse.h"
#include "convert.h"
#include "filemgr.h"
#include "globals.h"
#include "free.h"
#include "resource.h"
#include "shape.h"
/* only local used utility functions */
static int CountFunResults (node *fundef);
static int CountFunArgs (node *fundef);
/******************************************************************************
*
* function:
* node *MCWmodul(node *arg_node, node *arg_info)
*
* description:
* Traverses only in functions of module
*
******************************************************************************/
node *
MCWmodul (node *arg_node, node *arg_info)
{
DBUG_ENTER ("MCWmodul");
if (MODUL_FUNS (arg_node) != NULL) {
/* if there are some fundefs, traverse them */
DBUG_PRINT ("MCW", ("MCWmodul: analyse overloading of sac-functions...\n"));
INFO_MCW_MODUL (arg_info) = arg_node;
/* the modul node is needed to hang the wrapperchain in N_module */
Trav (MODUL_FUNS (arg_node), arg_info);
}
DBUG_RETURN (arg_node);
}
/******************************************************************************
*
* function:
* node *MCWfundef(node *arg_node, node *arg_info)
*
* description:
* Builds up N_cwrapper nodes for wrapper and nodelist with fundefs
*