Changeset 159c62e


Ignore:
Timestamp:
Jul 5, 2016, 4:33:46 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, ctor, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
9bb81bb
Parents:
d32c4e2
Message:

add small set of library types/routines to prelude to reduce including larger library files

Location:
src
Files:
1 added
1 deleted
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • src/libcfa/Makefile.am

    rd32c4e2 r159c62e  
    1111## Created On       : Sun May 31 08:54:01 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Mon Jun 13 14:27:22 2016
    14 ## Update Count     : 166
     13## Last Modified On : Tue Jul  5 16:19:31 2016
     14## Update Count     : 178
    1515###############################################################################
    1616
     
    1919# put into lib for now
    2020cfalibdir = ${libdir}
    21 cfalib_DATA = prelude.cf builtins.cf
     21cfalib_DATA = builtins.cf extras.cf prelude.cf
    2222
    2323# create forward declarations for gcc builtins
    24 ${libdir}/builtins.cf : ${libdir} ${srcdir}/builtins.cf
    25         ${INSTALL} ${srcdir}/builtins.cf ${libdir}
    26         sed -i -e "s#typedef.*ptrdiff_t.*#`@BACKEND_CC@ -E ${srcdir}/ptrdiff_t.c | grep 'typedef.*ptrdiff_t'`#" ${srcdir}/prelude.cf
     24extras.cf : extras.regx extras.c
     25        @BACKEND_CC@ -E ${srcdir}/extras.c | grep -f extras.regx > ${srcdir}/extras.cf
    2726
    2827builtins.cf : builtins.c
    29         @if [ -e $< ] ; then \
     28        if [ -e $< ] ; then \
    3029                @BACKEND_CC@ -E -P $^ | sed -e "/targetm/s/.*//" -e "/_Decimal/s/.*//" -e "s/void (const char \*)0();//" -e "s/\"//g" -e "s/\(__builtin_\) /\1/" > $@ ; \
    3130        fi
    3231
    3332builtins.c : builtins.def prototypes.awk
    34         @if [ -e $< ] ; then \
     33        if [ -e $< ] ; then \
    3534                @BACKEND_CC@ -E prototypes.c | awk -f prototypes.awk > $@ ; \
    3635        fi
     
    4039prototypes.awk :
    4140
    42 MAINTAINERCLEANFILES = ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}}
     41MAINTAINERCLEANFILES = builtins.cf extras.cf ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}}
    4342
    4443#--------------------------------------------------
    4544
    46 libcfa-prelude.c : ${srcdir}/prelude.cf
     45libcfa-prelude.c : ${srcdir}/prelude.cf ${srcdir}/extras.cf ${srcdir}/builtins.cf
    4746        ${abs_top_srcdir}/src/driver/cfa-cpp -l ${srcdir}/prelude.cf $@  # use src/cfa-cpp as not in lib until after install
    4847
     
    6463libcfa_a_SOURCES = libcfa-prelude.c ${headers:=.c}
    6564
    66 nobase_include_HEADERS = ${headers}
     65nobase_include_HEADERS = ${headers} stdio.h
    6766
    6867CLEANFILES = libcfa-prelude.c
    69 MAINTAINERCLEANFILES += ${includedir}/*
     68
     69maintainer-clean-local:
     70        -rm -rf ${includedir}/*
  • src/libcfa/Makefile.in

    rd32c4e2 r159c62e  
    230230# put into lib for now
    231231cfalibdir = ${libdir}
    232 cfalib_DATA = prelude.cf builtins.cf
    233 MAINTAINERCLEANFILES = ${addprefix ${libdir}/,${cfalib_DATA}} \
    234         ${addprefix ${libdir}/,${lib_LIBRARIES}} ${includedir}/*
     232cfalib_DATA = builtins.cf extras.cf prelude.cf
     233MAINTAINERCLEANFILES = builtins.cf extras.cf ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}}
    235234headers = limits stdlib math iostream fstream iterator rational containers/vector
    236235libobjs = ${headers:=.o}
    237236libcfa_a_SOURCES = libcfa-prelude.c ${headers:=.c}
    238 nobase_include_HEADERS = ${headers}
     237nobase_include_HEADERS = ${headers} stdio.h
    239238CLEANFILES = libcfa-prelude.c
    240239all: all-am
     
    564563        -rm -rf ./$(DEPDIR)
    565564        -rm -f Makefile
    566 maintainer-clean-am: distclean-am maintainer-clean-generic
     565maintainer-clean-am: distclean-am maintainer-clean-generic \
     566        maintainer-clean-local
    567567
    568568mostlyclean: mostlyclean-am
     
    593593        install-ps install-ps-am install-strip installcheck \
    594594        installcheck-am installdirs maintainer-clean \
    595         maintainer-clean-generic mostlyclean mostlyclean-compile \
    596         mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
    597         uninstall-am uninstall-cfalibDATA uninstall-libLIBRARIES \
    598         uninstall-nobase_includeHEADERS
     595        maintainer-clean-generic maintainer-clean-local mostlyclean \
     596        mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
     597        tags uninstall uninstall-am uninstall-cfalibDATA \
     598        uninstall-libLIBRARIES uninstall-nobase_includeHEADERS
    599599
    600600
    601601# create forward declarations for gcc builtins
    602 ${libdir}/builtins.cf : ${libdir} ${srcdir}/builtins.cf
    603         ${INSTALL} ${srcdir}/builtins.cf ${libdir}
    604         sed -i -e "s#typedef.*ptrdiff_t.*#`@BACKEND_CC@ -E ${srcdir}/ptrdiff_t.c | grep 'typedef.*ptrdiff_t'`#" ${srcdir}/prelude.cf
     602extras.cf : extras.regx extras.c
     603        @BACKEND_CC@ -E ${srcdir}/extras.c | grep -f extras.regx > ${srcdir}/extras.cf
    605604
    606605builtins.cf : builtins.c
    607         @if [ -e $< ] ; then \
     606        if [ -e $< ] ; then \
    608607                @BACKEND_CC@ -E -P $^ | sed -e "/targetm/s/.*//" -e "/_Decimal/s/.*//" -e "s/void (const char \*)0();//" -e "s/\"//g" -e "s/\(__builtin_\) /\1/" > $@ ; \
    609608        fi
    610609
    611610builtins.c : builtins.def prototypes.awk
    612         @if [ -e $< ] ; then \
     611        if [ -e $< ] ; then \
    613612                @BACKEND_CC@ -E prototypes.c | awk -f prototypes.awk > $@ ; \
    614613        fi
     
    620619#--------------------------------------------------
    621620
    622 libcfa-prelude.c : ${srcdir}/prelude.cf
     621libcfa-prelude.c : ${srcdir}/prelude.cf ${srcdir}/extras.cf ${srcdir}/builtins.cf
    623622        ${abs_top_srcdir}/src/driver/cfa-cpp -l ${srcdir}/prelude.cf $@  # use src/cfa-cpp as not in lib until after install
    624623
     
    632631${libobjs} : ${abs_top_srcdir}/src/driver/cfa-cpp       # add dependency to cfa-cpp so all libraries are rebuilt with new translator
    633632
     633maintainer-clean-local:
     634        -rm -rf ${includedir}/*
     635
    634636# Tell versions [3.59,3.63) of GNU make to not export all variables.
    635637# Otherwise a system limit (for SysV at least) may be exceeded.
  • src/libcfa/extras.c

    rd32c4e2 r159c62e  
    11#include <stddef.h>
     2#include <stdlib.h>
  • src/libcfa/stdlib

    rd32c4e2 r159c62e  
    1010// Created On       : Thu Jan 28 17:12:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun 30 15:04:18 2016
    13 // Update Count     : 97
     12// Last Modified On : Tue Jul  5 09:56:31 2016
     13// Update Count     : 98
    1414//
    15 
    16 //---------------------------------------
    17 
    18 extern "C" {
    19 #include <stddef.h>                                                                             // size_t
    20 } // extern "C"
    2115
    2216//---------------------------------------
     
    2721#define EXIT_SUCCESS    0                                                               // successful exit status
    2822#endif // ! EXIT_FAILURE
    29 void exit( int rc );
    30 void abort( void );
    3123} // extern "C"
    3224
  • src/main.cc

    rd32c4e2 r159c62e  
    1010// Created On       : Fri May 15 23:12:02 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Jun  5 15:57:30 2016
    13 // Update Count     : 205
     12// Last Modified On : Tue Jul  5 15:23:11 2016
     13// Update Count     : 209
    1414//
    1515
     
    214214                Parser::get_parser().set_debug( grammarp );
    215215
    216                 // read in the builtins and the prelude
     216                // read in the builtins, extras, and the prelude
    217217                if ( ! nopreludep ) {                                                   // include gcc builtins
    218218                        // -l is for initial build ONLY and builtins.cf is not in the lib directory so access it here.
     
    222222                                exit( EXIT_FAILURE );
    223223                        } // if
    224 
    225224                        parse( builtins, LinkageSpec::Compiler );
     225
     226                        // read the extra prelude in, if not generating the cfa library
     227                        FILE * extras = fopen( libcfap | treep ? "extras.cf" : CFA_LIBDIR "/extras.cf", "r" );
     228                        if ( extras == NULL ) {
     229                                std::cerr << "Error: can't open extras.cf" << std::endl;
     230                                exit( EXIT_FAILURE );
     231                        } // if
     232                        parse( extras, LinkageSpec::C );
    226233
    227234                        if ( ! libcfap ) {
Note: See TracChangeset for help on using the changeset viewer.