1 ## Process this file with automake to produce Makefile.in
3 # subdir-objects generates object files using the directory structure of the source files.
4 AUTOMAKE_OPTIONS = foreign nostdinc subdir-objects 1.7.2
6 SOURCE_DIR=$(top_srcdir)/Source
7 BUILD_SOURCE_DIR=$(top_builddir)/Source
9 SWIG_CXX_DEFS = @SWILL@
11 AM_CPPFLAGS = -I$(BUILD_SOURCE_DIR)/Include \
12 -I$(BUILD_SOURCE_DIR)/CParse \
13 -I$(SOURCE_DIR)/Include \
15 -I$(SOURCE_DIR)/CParse \
16 -I$(SOURCE_DIR)/Preprocessor \
17 -I$(SOURCE_DIR)/Swig \
18 -I$(SOURCE_DIR)/Modules
20 AM_CXXFLAGS = $(SWIG_CXX_DEFS)
24 BUILT_SOURCES = CParse/parser.h
25 eswig_SOURCES = CParse/cscanner.c \
37 Modules/allegrocl.cxx \
38 Modules/allocate.cxx \
43 Modules/contract.cxx \
45 Modules/directors.cxx \
54 Modules/mzscheme.cxx \
57 Modules/overload.cxx \
65 Modules/swigmain.cxx \
67 Modules/typepass.cxx \
93 eswig_LDADD = @SWIGLIBS@
95 # Override the link stage to avoid using Libtool
96 CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
98 # The executable is copied to the root directory for installation and running the test-suite.
99 # This occurs on each invocation of make and is a step towards providing support for multiple
101 all-local: eswig@EXEEXT@
102 cp -f $(top_builddir)/Source/eswig@EXEEXT@ $(top_builddir)/swig@EXEEXT@
105 rm -f $(top_builddir)/swig@EXEEXT@
106 rm -f core @EXTRA_CLEAN@
110 # Note that this works well on C code, but does some odd joining of lines for C++ code.
111 # Compiling with -DNDEBUG and no optimisations will allow one to do a binary diff of the
112 # swig executable as a way of checking before and after the 'beautifying'.
113 # Single files can be beautified with the beautify-file target, eg: 'make beautify-file INDENTFILE=chosenfile.c'
115 SWIGTYPEDEFS=-T File -T DohObjInfo -T Parm -T Language -T List -T Typetab -T ModuleFactory -T ErrorMessageFormat -T Symtab -T Hash -T String -T DohBase -T Node -T String_or_char -T SwigType -T Dispatcher -T Wrapper -T DohStringMethods -T DohFileMethods -T DohListMethods -T DohHashMethods -T DOH -T DohIterator -T ParmList -T FILE -T HashNode -T DOHString_or_char
116 INDENTBAKSDIR=../IndentBaks
119 rm -rf $(INDENTBAKSDIR)
120 mkdir $(INDENTBAKSDIR)
121 mkdir $(INDENTBAKSDIR)/CParse
122 mkdir $(INDENTBAKSDIR)/DOH
123 mkdir $(INDENTBAKSDIR)/Modules
124 mkdir $(INDENTBAKSDIR)/Preprocessor
125 mkdir $(INDENTBAKSDIR)/Swig
126 mkdir $(INDENTBAKSDIR)/Include
127 (csources=`find . -name "*.c"` && \
128 hsources=`find . -name "*.h"` && \
129 cxxsources=`find . -name "*.cxx"` && \
130 for file in $$csources $$hsources $$cxxsources; do \
131 $(MAKE) beautify-file INDENTFILE=$$file; \
135 test -e $(INDENTBAKSDIR) || (echo $(INDENTBAKSDIR) directory does not exist && exit 1;)
136 test -n "$(INDENTFILE)" || (echo INDENTFILE not defined && exit 1;)
137 test -e $(INDENTFILE) || (echo File does not exist: $(INDENTFILE) && exit 1;)
138 cp $(INDENTFILE) $(INDENTBAKSDIR)/$(INDENTFILE);
139 unix2dos $(INDENTFILE)
140 dos2unix $(INDENTFILE)
141 indent -kr --honour-newlines --line-length160 --indent-level2 --braces-on-func-def-line --leave-optional-blank-lines $(SWIGTYPEDEFS) $(INDENTFILE) -o $(INDENTFILE).tmp;
142 cat $(INDENTFILE).tmp | sed -e 's/const const /const /' > $(INDENTFILE);
143 rm $(INDENTFILE).tmp;