First milestone of replacing the build system.

--HG--
branch : dtrg-buildsystem
rename : lang/cem/cpp.ansi/Parameters => lang/cem/cpp.ansi/parameters.h
This commit is contained in:
David Given
2013-05-12 20:45:55 +01:00
parent bcfb3d802f
commit c1aca7dae5
119 changed files with 1584 additions and 319 deletions

View File

@@ -5,9 +5,7 @@
/* $Id$ */
/* L E X I C A L A N A L Y Z E R */
#include "idfsize.h"
#include "numsize.h"
#include "strsize.h"
#include "parameters.h"
#include <alloc.h>
#include "input.h"

View File

@@ -3,7 +3,7 @@
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
/* $Id$ */
#include "dobits.h"
#include "parameters.h"
#ifdef DOBITS
#define bit0 0x01
#define bit1 0x02

104
lang/cem/cpp.ansi/build.mk Normal file
View File

@@ -0,0 +1,104 @@
D := lang/cem/cpp.ansi
define build-cpp-ansi-allocd-header
$1: $2 $D/make.allocd
@echo ALLOCD $1
@mkdir -p $(dir $1)
$(hide) $D/make.allocd < $2 > $1
$(eval CLEANABLES += $1)
endef
define build-cpp-ansi-tokfile
$(OBJDIR)/$D/tokenfile.g: $D/make.tokfile $D/tokenname.c
@echo TOKENFILE $$@
@mkdir -p $$(dir $$@)
$(hide) sh $D/make.tokfile < $D/tokenname.c > $$@
$(eval CLEANABLES += $(OBJDIR)/$D/tokenfile.g)
endef
define build-cpp-ansi-tokcase
$(OBJDIR)/$D/symbol2str.c: $D/make.tokcase $D/tokenname.c
@echo TOKCASE $$@
@mkdir -p $$(dir $$@)
$(hide) sh $D/make.tokcase < $D/tokenname.c > $$@
$(eval CLEANABLES += $(OBJDIR)/$D/symbol2str.c)
endef
define build-cpp-ansi-next
$(OBJDIR)/$D/next.c: $D/make.next $D/macro.str $D/replace.str
@echo NEXT $$@
@mkdir -p $$(dir $$@)
$(hide) sh $D/make.next $D/macro.str $D/replace.str > $$@
$(eval CLEANABLES += $(OBJDIR)/$D/next.c)
endef
define build-cpp-ansi-impl
$(eval $(call build-cpp-ansi-next))
$(eval $(call build-cpp-ansi-tokcase))
$(eval $(call build-cpp-ansi-tokfile))
$(eval $(call build-cpp-ansi-allocd-header, \
$(OBJDIR)/$D/macro.h, $D/macro.str \
))
$(eval $(call build-cpp-ansi-allocd-header, \
$(OBJDIR)/$D/replace.h, $D/replace.str \
))
$(call reset)
$(eval cflags += -I$(OBJDIR)/$D -I$D)
$(call cfile, $D/LLlex.c)
$(call cfile, $D/LLmessage.c)
$(call cfile, $D/ch3bin.c)
$(call cfile, $D/ch3mon.c)
$(call cfile, $D/domacro.c)
$(call cfile, $D/error.c)
$(call cfile, $D/idf.c)
$(call cfile, $D/init.c)
$(call cfile, $D/input.c)
$(call cfile, $D/main.c)
$(call cfile, $D/options.c)
$(call cfile, $D/preprocess.c)
$(call cfile, $D/replace.c)
$(call cfile, $D/skip.c)
$(call cfile, $D/tokenname.c)
$(call cfile, $D/expr.c)
$(call cfile, $(OBJDIR)/$D/symbol2str.c)
$(call cfile, $(OBJDIR)/$D/next.c)
$(call llgen, $(OBJDIR)/$D, $(OBJDIR)/$D/tokenfile.g $D/expression.g)
$(call file, $(LIBINPUT))
$(call file, $(LIBASSERT))
$(call file, $(LIBALLOC))
$(call file, $(LIBPRINT))
$(call file, $(LIBSYSTEM))
$(call file, $(LIBSTRING))
$(call tabgen, $D/char.tab)
$(eval $q: \
$(OBJDIR)/$D/macro.h \
$(OBJDIR)/$D/Lpars.h \
$(INCDIR)/alloc.h \
$(INCDIR)/inp_pkg.spec \
$(INCDIR)/idf_pkg.spec \
$(OBJDIR)/$D/replace.h \
$(INCDIR)/system.h \
$(INCDIR)/inp_pkg.body \
$(INCDIR)/inp_pkg.spec \
$(INCDIR)/idf_pkg.body)
$(call cprogram, $(BINDIR)/cpp.ansi)
$(call installto, $(PLATDEP)/cpp.ansi)
$(eval CPPANSI := $o)
$(call reset)
$(eval q := $D/ncpp.6)
$(call installto, $(INSDIR)/share/man/man6/cpp.ansi.6)
endef
$(eval $(build-cpp-ansi-impl))

View File

@@ -5,25 +5,19 @@
/* $Id$ */
/* PREPROCESSOR: CONTROLLINE INTERPRETER */
#include <stdlib.h>
#include "arith.h"
#include "LLlex.h"
#include "Lpars.h"
#include "idf.h"
#include "input.h"
#include "ifdepth.h"
#include "botch_free.h"
#include "nparams.h"
#include "parbufsize.h"
#include "textsize.h"
#include "idfsize.h"
#include "debug.h"
#include "parameters.h"
#include <assert.h>
#include <alloc.h>
#include "class.h"
#include "macro.h"
#include "bits.h"
#include "macbuf.h"
#include "replace.h"
extern char options[];

View File

@@ -12,8 +12,8 @@
#include <varargs.h>
#endif
#include "parameters.h"
#include "arith.h"
#include "errout.h"
#include "LLlex.h"
/* This file contains the (non-portable) error-message and diagnostic

View File

@@ -4,7 +4,6 @@
*/
/* $Id$ */
#define INP_PUSHBACK 3
#include "inputtype.h"
#include <inp_pkg.spec>
/* Note: The following macro only garuantees one PushBack.

View File

@@ -5,14 +5,14 @@
/* $Id$ */
/* MAIN PROGRAM */
#include "debug.h"
#include <stdlib.h>
#include "parameters.h"
#include <alloc.h>
#include <assert.h>
#include <system.h>
#include "arith.h"
#include "file_info.h"
#include "idfsize.h"
#include "idf.h"
#include "macro.h"

View File

@@ -1,35 +0,0 @@
#!/bin/sh
: Update Files from database
PATH=/bin:/usr/bin
case $# in
1) ;;
*) echo use: $0 file >&2
exit 1
esac
(
IFCOMMAND="if [ -r \$FN ] ;\
then if cmp -s \$FN \$TMP;\
then rm \$TMP;\
else mv \$TMP \$FN;\
echo update \$FN;\
fi;\
else mv \$TMP \$FN;\
echo create \$FN;\
fi"
echo 'TMP=.uf$$'
echo 'FN=$TMP'
echo 'cat >$TMP <<\!EOF!'
sed -n '/^!File:/,${
/^$/d
/^!File:[ ]*\(.*\)$/s@@!EOF!\
'"$IFCOMMAND"'\
FN=\1\
cat >$TMP <<\\!EOF!@
p
}' $1
echo '!EOF!'
echo $IFCOMMAND
) | eval "$(cat)"

View File

@@ -8,7 +8,7 @@
#include <stdlib.h>
#include <string.h>
#include "alloc.h"
#include "idfsize.h"
#include "parameters.h"
#include "class.h"
#include "macro.h"
#include "idf.h"

View File

@@ -1,72 +1,67 @@
!File: pathlength.h
#ifndef PARAMETERS_H
#define PARAMETERS_H
#define PATHLENGTH 1024 /* max. length of path to file */
!File: errout.h
#define ERROUT STDERR /* file pointer for writing messages */
#define MAXERR_LINE 5 /* maximum number of error messages given
on the same input line. */
!File: idfsize.h
#define IDFSIZE 64 /* maximum significant length of an identifier */
!File: numsize.h
#define NUMSIZE 256 /* maximum length of a numeric constant */
!File: nparams.h
#define NPARAMS 32 /* maximum number of parameters of macros */
#define STDC_NPARAMS 31 /* ANSI limit on number of parameters */
!File: ifdepth.h
#define IFDEPTH 256 /* maximum number of nested if-constructions */
!File: macbuf.h
#define LAPBUF 128 /* initial size of macro replacement buffer */
#define ARGBUF 128 /* initial size of macro parameter buffer(s) */
!File: strsize.h
#define ISTRSIZE 16 /* minimum number of bytes allocated for
storing a string */
!File: botch_free.h
/*#define BOTCH_FREE 1 /* botch freed memory, as a check */
#if 0
#define BOTCH_FREE 1 /* botch freed memory, as a check */
#endif
!File: debug.h
/*#define DEBUG 1 /* perform various self-tests */
#if 0
#define DEBUG 1 /* perform various self-tests */
#endif
#define NDEBUG 1 /* disable assertions */
!File: parbufsize.h
#define PARBUFSIZE 1024
!File: textsize.h
#define ITEXTSIZE 16 /* 1st piece of memory for repl. text */
!File: inputtype.h
/*#define INP_READ_IN_ONE 1 /* read input file in one. */
#if 0
#define INP_READ_IN_ONE 1 /* read input file in one. */
/* If defined, we cannot read from a pipe */
#endif
!File: obufsize.h
#define OBUFSIZE 8192 /* output buffer size */
!File: dobits.h
#define DOBITS 1 /* use trick to reduce symboltable accesses */
!File: ln_prefix.h
#define LINE_PREFIX "#" /* prefix for generated line directives,
either "#" or "#line"
*/
#endif

View File

@@ -10,16 +10,13 @@
#include <system.h>
#include <alloc.h>
#include "input.h"
#include "obufsize.h"
#include "parameters.h"
#include "arith.h"
#include "LLlex.h"
#include "class.h"
#include "macro.h"
#include "idf.h"
#include "idfsize.h"
#include "bits.h"
#include "ln_prefix.h"
#include "textsize.h"
char _obuf[OBUFSIZE];
#ifdef DOBITS

View File

@@ -9,11 +9,7 @@
#include <stdio.h>
#include <string.h>
#include "pathlength.h"
#include "strsize.h"
#include "nparams.h"
#include "idfsize.h"
#include "numsize.h"
#include "parameters.h"
#include "alloc.h"
#include "idf.h"
#include "input.h"
@@ -21,9 +17,7 @@
#include "arith.h"
#include "LLlex.h"
#include "class.h"
#include "debug.h"
#include "assert.h"
#include "macbuf.h"
#include "replace.h"
extern char *GetIdentifier();