Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. LIBRARY= libstdc++
  2.  
  3. CC = kos32-gcc
  4. AR = kos32-ar
  5. LD = kos32-ld
  6. CPP= kos32-g++
  7. STRIP = kos32-strip
  8.  
  9. INSTALLDIR:= /home/autobuild/tools/win32/mingw32/lib
  10.  
  11. export SDK_DIR:= $(abspath ../../../../../sdk)
  12.  
  13. CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -fno-ident -fomit-frame-pointer
  14. CFLAGS+= -nostdinc++ -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi
  15. CFLAGS+= -fdiagnostics-show-location=once -ffunction-sections -fdata-sections
  16.  
  17. ARFLAGS= crs
  18.  
  19. GLIBCXX_INCLUDE_DIR= ../include
  20. INCLUDES= -I../include/mingw32 -I../include -I../libsupc++ -I$(SDK_DIR)/sources/newlib/libc/include
  21.  
  22. LIBS:=  -ldll -lc.dll
  23.  
  24. GLIBCXX_ABI_FLAGS = -D_GLIBCXX_USE_CXX11_ABI=0
  25. PARALLEL_FLAGS = -D_GLIBCXX_PARALLEL
  26.  
  27. DEFINES= -D_GLIBCXX_HAVE_TLS
  28.  
  29. CXXCOMPILE= $(CPP) $(CFLAGS) $(INCLUDES) $(DEFINES)
  30.  
  31.  
  32. cxx98_sources = \
  33.         c++98/compatibility.cc \
  34.         c++98/compatibility-debug_list.cc       \
  35.         c++98/compatibility-debug_list-2.cc
  36.  
  37. cxx11_sources = \
  38.         c++11/compatibility-c++0x.cc \
  39.         c++11/compatibility-atomic-c++0x.cc \
  40.         c++11/compatibility-thread-c++0x.cc \
  41.         c++11/compatibility-chrono.cc \
  42.         c++11/compatibility-condvar.cc
  43.  
  44. compat_sources = $(cxx98_sources) $(cxx11_sources)
  45.  
  46. cow_string_host_sources = \
  47.         c++98/collate_members_cow.cc \
  48.         c++98/messages_members_cow.cc \
  49.         c++98/monetary_members_cow.cc \
  50.         c++98/numeric_members_cow.cc
  51.  
  52.  
  53. # Source files linked in via configuration/make substitution for a
  54. # particular host.
  55. host_sources = \
  56.         $(cow_string_host_sources)              \
  57.         c++98/atomicity.cc                      \
  58.         c++98/codecvt_members.cc                \
  59.         c++98/collate_members.cc                \
  60.         c++98/messages_members.cc               \
  61.         c++98/monetary_members.cc               \
  62.         c++98/numeric_members.cc                \
  63.         c++98/time_members.cc
  64.  
  65. # Source files linked in via configuration/make substitution for a
  66. # particular host, but with ad hoc naming rules.
  67. host_sources_extra = \
  68.         c++98/basic_file.cc c++98/c++locale.cc \
  69.         ${inst_sources} ${parallel_sources}
  70.  
  71. cxx11_abi_sources = \
  72.         c++98/cow-istream-string.cc
  73.  
  74.  
  75. inst_sources = \
  76.         c++98/allocator-inst.cc \
  77.         c++98/concept-inst.cc \
  78.         c++98/ext-inst.cc \
  79.         c++98/misc-inst.cc \
  80.  
  81. parallel_sources = c++98/parallel_settings.cc
  82.  
  83. sources = \
  84.     c++98/bitmap_allocator.cc       \
  85.     c++98/pool_allocator.cc         \
  86.     c++98/mt_allocator.cc       \
  87.     c++98/codecvt.cc            \
  88.     c++98/complex_io.cc         \
  89.     c++98/globals_io.cc         \
  90.     c++98/hash_tr1.cc           \
  91.     c++98/hashtable_tr1.cc      \
  92.     c++98/ios_failure.cc        \
  93.     c++98/ios_init.cc           \
  94.     c++98/ios_locale.cc         \
  95.     c++98/list.cc           \
  96.     c++98/list-aux.cc           \
  97.     c++98/list-aux-2.cc         \
  98.     c++98/list_associated.cc        \
  99.     c++98/list_associated-2.cc      \
  100.     c++98/locale.cc             \
  101.     c++98/locale_init.cc        \
  102.     c++98/locale_facets.cc      \
  103.     c++98/localename.cc         \
  104.     c++98/math_stubs_float.cc       \
  105.     c++98/math_stubs_long_double.cc     \
  106.     c++98/stdexcept.cc          \
  107.     c++98/strstream.cc          \
  108.     c++98/tree.cc           \
  109.     c++98/istream.cc            \
  110.     c++98/istream-string.cc     \
  111.     c++98/streambuf.cc          \
  112.     c++98/valarray.cc           \
  113.         ${cxx11_abi_sources}                    \
  114.         ${host_sources}                         \
  115.         ${host_sources_extra}
  116.  
  117.  
  118. host_sources_11 = \
  119.     c++11/ctype_configure_char.cc \
  120.     c++11/ctype_members.cc
  121.  
  122. cxx11_abi_sources_11 = \
  123.     c++11/cow-locale_init.cc \
  124.     c++11/cow-shim_facets.cc \
  125.     c++11/cxx11-hash_tr1.cc \
  126.     c++11/cxx11-ios_failure.cc \
  127.     c++11/cxx11-shim_facets.cc \
  128.     c++11/cxx11-stdexcept.cc
  129.  
  130. sources_11 = \
  131.     c++11/chrono.cc \
  132.     c++11/codecvt.cc \
  133.     c++11/condition_variable.cc \
  134.     c++11/cow-stdexcept.cc \
  135.     c++11/ctype.cc \
  136.     c++11/debug.cc \
  137.     c++11/functexcept.cc \
  138.     c++11/functional.cc \
  139.     c++11/futex.cc \
  140.     c++11/future.cc \
  141.     c++11/hash_c++0x.cc \
  142.     c++11/hashtable_c++0x.cc \
  143.     c++11/ios.cc \
  144.     c++11/limits.cc \
  145.     c++11/mutex.cc \
  146.     c++11/placeholders.cc \
  147.     c++11/random.cc \
  148.     c++11/regex.cc  \
  149.     c++11/shared_ptr.cc \
  150.     c++11/snprintf_lite.cc \
  151.     c++11/system_error.cc \
  152.     c++11/thread.cc \
  153.         ${cxx11_abi_sources_11} \
  154.         ${host_sources_11}
  155.  
  156.  
  157. extra_string_inst_sources = \
  158.     c++11/cow-fstream-inst.cc \
  159.     c++11/cow-sstream-inst.cc \
  160.     c++11/cow-string-inst.cc \
  161.     c++11/cow-wstring-inst.cc \
  162.     c++11/cxx11-locale-inst.cc \
  163.     c++11/cxx11-wlocale-inst.cc
  164.  
  165. inst_sources_11 = \
  166.         $(extra_string_inst_sources) \
  167.     c++11/ext11-inst.cc \
  168.     c++11/fstream-inst.cc \
  169.     c++11/ios-inst.cc \
  170.     c++11/iostream-inst.cc \
  171.     c++11/istream-inst.cc \
  172.     c++11/locale-inst.cc \
  173.     c++11/ostream-inst.cc \
  174.     c++11/sstream-inst.cc \
  175.     c++11/streambuf-inst.cc \
  176.     c++11/string-inst.cc \
  177.     c++11/wlocale-inst.cc \
  178.     c++11/wstring-inst.cc
  179.  
  180. sources_11+= $(inst_sources_11)
  181.  
  182. OBJ98 =  $(patsubst %.cc, %.o, $(patsubst %.c, %.o, $(sources)))
  183.  
  184. OBJ11 =  $(patsubst %.cc, %.o, $(patsubst %.c, %.o, $(sources_11)))
  185.  
  186. com_obj =  $(patsubst %.cc, %.o, $(patsubst %.c, %.o, $(compat_sources)))
  187.  
  188. # targets
  189.  
  190. all:$(LIBRARY).a
  191.  
  192. #$(LIBRARY).a: $(OBJ98) $(OBJ11) $(com_obj) Makefile
  193.  
  194. $(LIBRARY).a: $(OBJ98) $(OBJ11) $(com_obj) Makefile
  195.         $(AR) $(ARFLAGS) $(LIBRARY).a $(OBJ98) $(OBJ11) $(com_obj)
  196.         mv -f $(LIBRARY).a $(INSTALLDIR)
  197.  
  198. %.o : %.c Makefile
  199.         $(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $<
  200.  
  201. #src/%.o : src/%.cc Makefile
  202. #       $(CXXCOMPILE) -o $@ $<
  203.  
  204.  
  205.  
  206. c++98/%.o : c++98/%.cc Makefile
  207.         $(CXXCOMPILE) -o $@ $<
  208.  
  209. c++11/%.o : c++11/%.cc Makefile
  210.         $(CXXCOMPILE) -std=gnu++11 -o $@ $<
  211.  
  212. c++98/collate_members_cow.o: c++98/collate_members_cow.cc
  213.         $(CXXCOMPILE) $(GLIBCXX_ABI_FLAGS) -fimplicit-templates -o $@ $<
  214.  
  215. c++98/messages_members_cow.o: c++98/messages_members_cow.cc
  216.         $(CXXCOMPILE) $(GLIBCXX_ABI_FLAGS) -fimplicit-templates -o $@ $<
  217.  
  218. c++98/monetary_members_cow.o: c++98/monetary_members_cow.cc
  219.         $(CXXCOMPILE) $(GLIBCXX_ABI_FLAGS) -fimplicit-templates -o $@ $<
  220.  
  221. c++98/numeric_members_cow.o: c++98/numeric_members_cow.cc
  222.         $(CXXCOMPILE) $(GLIBCXX_ABI_FLAGS) -fimplicit-templates -o $@ $<
  223.  
  224. c++98/locale_init.o: c++98/locale_init.cc
  225.         $(CXXCOMPILE) -std=gnu++11 -o $@ $<
  226.  
  227. c++98/localename.o: c++98/localename.cc
  228.         $(CXXCOMPILE) -std=gnu++11 -o $@ $<
  229.  
  230. c++98/strstream.o: c++98/strstream.cc Makefile
  231.         $(CXXCOMPILE) -I$(GLIBCXX_INCLUDE_DIR)/backward -Wno-deprecated -o $@ $<
  232.  
  233. # Use special rules for the concept-checking instantiations so that all
  234.  
  235. # the generated template functions are also instantiated.  Force the checks
  236.  
  237. # to be on so that the instantiations are actually seen.
  238.  
  239. c++98/concept-inst.o: c++98/concept-inst.cc
  240.         $(CXXCOMPILE) -D_GLIBCXX_CONCEPT_CHECKS -fimplicit-templates -o $@ $<
  241.  
  242. c++98/parallel_settings.o: c++98/parallel_settings.cc
  243.         $(CXXCOMPILE) $(PARALLEL_FLAGS) -o $@ $<
  244.  
  245.  
  246. c++11/hashtable_c++0x.o: c++11/hashtable_c++0x.cc
  247.         $(CXXCOMPILE) -std=gnu++11 -fimplicit-templates -o $@ $<
  248.  
  249. c++11/compatibility-c++0x.o: c++11/compatibility-c++0x.cc
  250.         $(CXXCOMPILE) -std=gnu++11 -o $@ $<
  251.  
  252. c++11/compatibility-thread-c++0x.o: c++11/compatibility-thread-c++0x.cc
  253.         $(CXXCOMPILE) -std=gnu++11 -o $@ $<
  254.  
  255. c++11/compatibility-chrono.o: c++11/compatibility-chrono.cc
  256.         $(CXXCOMPILE) -std=gnu++11 -o $@ $<
  257.  
  258. c++11/compatibility-condvar.o: c++11/compatibility-condvar.cc
  259.         $(CXXCOMPILE) -std=gnu++11 -o $@ $<
  260.  
  261. clean:
  262.         -rm -f *.o
  263.  
  264.