Skip to content
Commits on Source (4)
# for variables passed from parent makefile see ../SOURCE_TOOLS/parent_make.txt
.SUFFIXES: .o .cxx .depend
OBJECTS = mkptypes.o
BINARY = aisc_mkpt
LOCAL_DEFINES=-DSIMPLE_ARB_ASSERT
LOCAL_MAKEDEPENDFLAGS=$(MAKEDEPENDFLAGS) $(LOCAL_DEFINES)
$(MAIN): $(BINARY)
$(BINARY): $(OBJECTS) $(use_ARB_main)
$(LINK_EXECUTABLE) $@ $(use_ARB_main) $(OBJECTS) $(EXECLIBS)
.cxx.o:
$(A_CXX) $(cflags) $(cxxflags) $(LOCAL_DEFINES) -c $< $(CXX_INCLUDES) $(POST_COMPILE)
clean:
rm -f $(OBJECTS) $(BINARY)
#depends:
# @echo "No depends here"
DEPENDS = $(OBJECTS:.o=.depend)
depends: $(DEPENDS)
@cat $(DEPENDS) | grep -v '^#' >>Makefile
@rm $(DEPENDS)
$(DEPENDS): depend.init
depend.init:
$(MAKEDEPEND) $(LOCAL_MAKEDEPENDFLAGS) 2>/dev/null # remove dependencies
.cxx.depend:
$(MAKEDEPEND) -f- $(LOCAL_MAKEDEPENDFLAGS) $< 2>/dev/null >$@
# DO NOT DELETE THIS LINE -- make depend depends on it.
# Do not add dependencies manually - use 'make depend' in $ARBHOME
# For formatting issues see SOURCE_TOOLS/fix_depends.pl (from main)
mkptypes.o: $(ARBHOME)/INCLUDE/arb_assert.h
mkptypes.o: $(ARBHOME)/INCLUDE/arb_early_check.h
mkptypes.o: $(ARBHOME)/INCLUDE/arb_simple_assert.h
mkptypes.o: $(ARBHOME)/INCLUDE/arbtools.h
mkptypes.o: $(ARBHOME)/INCLUDE/attributes.h
mkptypes.o: $(ARBHOME)/INCLUDE/cxxforward.h
mkptypes.o: $(ARBHOME)/INCLUDE/dupstr.h
mkptypes.o: $(ARBHOME)/INCLUDE/gccver.h
mkptypes.o: $(ARBHOME)/INCLUDE/static_assert.h
mkptypes.o: $(ARBHOME)/INCLUDE/test_global.h
mkptypes.o: $(ARBHOME)/INCLUDE/test_unit.h
This diff is collapsed.
# libraries needed to link against AISC_MKPTPS/mkptypes.o
# none
.SUFFIXES: .o .cxx
SED:=$(ARBHOME)/SH/arb_sed
all:
@echo "use make clean"
# --------------------------------------------------------------------------------
OBJECTS=arb_main_cpp.o arb_main_c.o
ARB_MAIN_DEPENDS=Makefile arb_main.h
arb_main_cpp.o: arb_main.cxx $(ARB_MAIN_DEPENDS)
$(A_CXX) $(cflags) $(cxxflags) -c $< -o $@ $(CXX_INCLUDES) $(POST_COMPILE)
arb_main_c.o: arb_main.c $(ARB_MAIN_DEPENDS) arb_main.cxx
$(A_CC) $(cflags) -c $< -o $@ $(CC_INCLUDES) $(POST_COMPILE)
mainwrapper: $(OBJECTS)
# --------------------------------------------------------------------------------
clean:
rm -f stamp.* valgrind2grep.lst postcompile.sav $(OBJECTS)
valgrind_update:
./arb_valgrind update
# --------------------------------------------------------------------------------
# library dependencies generated here always use dynamic libnames,
# even if LINK_STATIC=1 defined in ../Makefile@LINK_STATIC
#
# The files generated here are not used yet (so the above does not matter)
# They are intended to be used to link all ARB binaries
# (instead of using explicit link commands in ../Makefile)
% : %.tmp
./mv_if_diff $< $@
CORE_LIB=lib/libCORE.so
TMP=dep.alltargets.tmp.tmp
dep.alltargets.tmp: Makefile needed_libs.pl
LINK_STATIC=0;./needed_libs.pl -U -I -F $(CORE_LIB) > $(TMP)
$(SED) -e 's/ /\n/g' < $(TMP) > $@
rm $(TMP)
echo $(CORE_LIB) >>$@
dep.libtargets: dep.alltargets
grep -E '\.(a|o|so)' $< > $@ || true
dep.4dummy.tmp: dep.libtargets
./gen_dep.pl dummy <$< >$@
libdepends: dep.4dummy
MAIN_MAKE=$(MAKE) -C $(ARBHOME)
REV_CHECK=$(ARBHOME)/SOURCE_TOOLS/rev_check.sh
SUCCEEDED_REVISION:=$(shell $(REV_CHECK) last_succeeded)
CURRENT_REVISION:=$(shell $(REV_CHECK) current)
ifeq ($(SUCCEEDED_REVISION),$(CURRENT_REVISION))
UPTODATE=1
else
UPTODATE=0
endif
build_CTARGET:
ifeq ($(CTARGET),)
@echo "Error: You have to pass CTARGET to Makefile"
false
else
@echo "Last success: '$(SUCCEEDED_REVISION)'"
@echo "Current rev: '$(CURRENT_REVISION)'"
# @echo "Uptodate: '$(UPTODATE)'"
ifeq ($(UPTODATE),0)
@echo "Need to make '$(CTARGET)'"
+$(MAIN_MAKE) $(CTARGET)
$(REV_CHECK) set_succeeded
else
@echo "Already did a successful '$(CTARGET)' for [$(SUCCEEDED_REVISION)]"
endif
endif
reset:
$(REV_CHECK) reset
#include "arb_main.cxx"
// main-wrapper
#include <arb_main.h>
int ARB_main(int argc, char *argv[]);
int main(int argc, char **argv) {
// this is the only main() we like in production code
// other main()'s occur in test-code
start_of_main();
return ARB_main(argc, argv);
}
// ================================================================ //
// //
// File : arb_main.h //
// Purpose : code executed at start of main() //
// //
// Coded by Ralf Westram (coder@reallysoft.de) in February 2014 //
// http://www.arb-home.de/ //
// //
// ================================================================ //
#ifndef ARB_MAIN_H
#define ARB_MAIN_H
#include <locale.h>
static void start_of_main() {
// const char *USER_LOCALE = ""; // -> use user-defined locale
// const char *USER_LOCALE = "de_DE.UTF-8"; // use german locale
// gtk apparently calls 'setlocale(LC_ALL, "");'
// @@@ we should already call it here, to make ARB-motif-version behave samesame.
// --------------------------------------------------------------------------------
// Fails-counts mentioned below were determined under ubuntu 13.10/64bit.
// Make sure only one section is enabled!
#if 1
// enabling this section does not fail any unit test
setlocale(LC_ALL, "C");
// overwritten as soon as gtk-GUI starts (causing wrong behavior throughout ARB)
#endif
#if 0
// enabling this section does not fail any unit test
setlocale(LC_ALL, USER_LOCALE);
setlocale(LC_NUMERIC, "C");
#endif
#if 0
// enabling this section does not fail any unit test
setlocale(LC_ALL, "C");
setlocale(LC_COLLATE, USER_LOCALE);
setlocale(LC_CTYPE, USER_LOCALE);
setlocale(LC_MESSAGES, USER_LOCALE);
setlocale(LC_MONETARY, USER_LOCALE);
setlocale(LC_TIME, USER_LOCALE);
#endif
#if 0
// enabling this section fails 57 unit tests (for german USER_LOCALE)
setlocale(LC_ALL, USER_LOCALE);
#endif
#if 0
// enabling this section fails 57 unit tests (for german USER_LOCALE)
setlocale(LC_COLLATE, "C");
setlocale(LC_CTYPE, "C");
setlocale(LC_MESSAGES, "C");
setlocale(LC_MONETARY, "C");
setlocale(LC_NUMERIC, USER_LOCALE);
setlocale(LC_TIME, "C");
#endif
#if 0
// enabling this section fails 57 unit tests (for german USER_LOCALE)
// (fails 57 unit tests under ubuntu 13.10, centos 5 and 6)
setlocale(LC_ALL, "C");
setlocale(LC_NUMERIC, USER_LOCALE);
#endif
}
#else
#error arb_main.h included twice
#endif // ARB_MAIN_H
// ================================================================ //
// //
// File : arb_early_check.h //
// Purpose : early check for 32/64bit mismatch //
// //
// Coded by Ralf Westram (coder@reallysoft.de) in December 2012 //
// Institute of Microbiology (Technical University Munich) //
// http://www.arb-home.de/ //
// //
// ================================================================ //
#ifndef ARB_EARLY_CHECK_H
#define ARB_EARLY_CHECK_H
#ifndef STATIC_ASSERT_H
#include "static_assert.h"
#endif
// --------------------------------------------------------------------------------
// if any of the assertions below fails, then ...
//
// - edit ../config.makefile and correct ARB_64 to match your machine
// - make clean
// - make all
#if defined(ARB_64)
STATIC_ASSERT_ANNOTATED(sizeof(void*) == 8, "You cannot compile a 64bit-ARB on a 32bit-machine");
#else // !defined(ARB_64)
STATIC_ASSERT_ANNOTATED(sizeof(void*) == 4, "You cannot compile a 32bit-ARB on a 64bit-machine");
#endif
#else
#error arb_early_check.h included twice
#endif // ARB_EARLY_CHECK_H
// ============================================================ //
// //
// File : arb_simple_assert.h //
// Purpose : simple assert (independent from libCORE) //
// //
// Coded by Ralf Westram (coder@reallysoft.de) in June 2013 //
// Institute of Microbiology (Technical University Munich) //
// http://www.arb-home.de/ //
// //
// ============================================================ //
#ifndef ARB_SIMPLE_ASSERT_H
#define ARB_SIMPLE_ASSERT_H
#if !defined(SIMPLE_ARB_ASSERT)
#error you have to define SIMPLE_ARB_ASSERT in Makefile and pass it to compiler and makedepend
// please DO NOT define SIMPLE_ARB_ASSERT in code
#endif
#ifndef ARB_ASSERT_H
#include <arb_assert.h>
#else
#error included arb_simple_assert.h too late (arb_assert.h already has been included)
#endif
#else
#error arb_simple_assert.h included twice
#endif // ARB_SIMPLE_ASSERT_H