From 55441b4451390ae74a282110570e7fd336f737c8 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 17 Jan 2014 14:15:08 +0000 Subject: [PATCH] added H2.Wide. did some makefile experiments --- cmd/stream.ads | 7 +++--- lib/Makefile.in | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ lib/h2-wide.ads | 9 ++++++++ lib/lib.gpr.in | 6 +++-- 4 files changed, 74 insertions(+), 6 deletions(-) create mode 100644 lib/h2-wide.ads diff --git a/cmd/stream.ads b/cmd/stream.ads index bc71801..857cd6e 100644 --- a/cmd/stream.ads +++ b/cmd/stream.ads @@ -1,11 +1,10 @@ -with H2.Scheme; -with H2.Utf8; +with H2.Wide; with Ada.Wide_Text_IO; package Stream is - package S is new H2.Scheme (Standard.Wide_Character); - package Utf8 is new H2.Utf8 (Standard.Character, Standard.Wide_Character); + package S renames H2.Wide.Scheme; + package Utf8 renames H2.Wide.Utf8; ------------------------------------------------------------ --type Object_Character_Array_Pointer is access all S.Object_Character_Array; diff --git a/lib/Makefile.in b/lib/Makefile.in index 71fdb85..cc7688f 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -22,3 +22,61 @@ clean: distclean: clean + + +ADAFLAGS := -gnatA -fPIC -gnata -gnato -gnatN -gnatwl -lgnat95 -gnatW8 -g +BINDFLAGS := -x -shared + + +SRCS := h2.ads h2-ascii.ads h2-pool.adb h2-scheme.adb h2-utf8.adb h2-wide.ads +ALIS := $(patsubst %.ads,%.ali,$(patsubst %.adb,%.ali,$(SRCS))) +OBJS := $(ALIS:.ali=.o) + +BINDALI := b~h2.adb + +libh2: $(ALIS) $(BINDALI) + gnatbind ${BINDFLAGS} -o b~h2.adb -n -Lh2 $(ALIS) + gcc -c -x ada ${ADAFLAGS} b~h2.adb + gcc -shared -o libh2.so $(OBJS) b~h2.o -L. -lgnat + +# gcc -c -x ada ${ADAFLAGS} ../../lib/h2.ads +# gcc -c -x ada ${ADAFLAGS} ../../lib/h2-ascii.ads +# gcc -c -x ada ${ADAFLAGS} ../../lib/h2-pool.adb +# gcc -c -x ada ${ADAFLAGS} ../../lib/h2-scheme.adb +# gcc -c -x ada ${ADAFLAGS} ../../lib/h2-utf8.adb +# gcc -c -x ada ${ADAFLAGS} ../../lib/h2-wide.ads +# gnatbind ${BINDFLAGS} -o b~h2.adb -n -Lh2 h2.ali h2-ascii.ali h2-pool.ali h2-scheme.ali h2-utf8.ali h2-wide.ali +# #gnatbind ${BINDFLAGS} -C -o b~h2.c -n -Lh2 h2.ali h2-scheme.ali h2-pool.ali #for a show +# gcc -c -x ada ${ADAFLAGS} b~h2.adb +# gcc -shared -o libh2.so h2.o h2-ascii.o h2-pool.o h2-scheme.o h2-utf8.o h2-wide.o b~h2.o -L. -lgnat +# #gnatlink -v -v -olibh2.so h2 + + +#h2cmd: +# gcc -c -x ada ${ADAFLAGS} -I../../lib ../../cmd/storage.adb +# gcc -c -x ada ${ADAFLAGS} -I../../lib ../../cmd/stream.adb +# gcc -c -x ada ${ADAFLAGS} -I../../lib ../../cmd/scheme.adb +# gnatbind ${BINDFLAGS} -o b~scheme.adb scheme.ali storage.ali #-I- -I. -O +# gcc -c -x ada ${ADAFLAGS} b~scheme.adb +# gcc -oh2scm b~scheme.o storage.o stream.o scheme.o -L. -lh2 -Wl,-rpath=. #-lgnat-4.1 +# #gnatlink -v -v -o h2scm scheme +# #/usr/bin/gnatbind -x -shared -o b__scheme.adb ./scheme.ali ./storage.ali -I- -I. -I../lib/objdir -O +# #gcc -c -x ada -gnatA -gnata -gnato -gnatN -gnatwl -c -gnatA -gnatWb -gnatiw -gnatws b__scheme.adb -o b__scheme.o +# #gcc -oh2scm scheme.o b__scheme.o storage.o -shared-libgcc -L../lib -lh2 -Wl,-rpath=../lib -L -lgna + + +#.SUFFIXES: .ads .adb .ali +#.ads.ali: +# gcc -c -x ada ${ADAFLAGS} @abs_srcdir@/$< +# +#.adb.ali: +# gcc -c -x ada ${ADAFLAGS} @abs_srcdir@/$< + +$(BINDALI): + +%.ali: @abs_srcdir@/%.adb + gcc -c -x ada ${ADAFLAGS} $< + +%.ali: @abs_srcdir@/%.ads + gcc -c -x ada ${ADAFLAGS} $< + diff --git a/lib/h2-wide.ads b/lib/h2-wide.ads new file mode 100644 index 0000000..5f815c0 --- /dev/null +++ b/lib/h2-wide.ads @@ -0,0 +1,9 @@ +with H2.Scheme; +with H2.Utf8; + +package H2.Wide is + + package Scheme is new H2.Scheme (Standard.Wide_Character); + package Utf8 is new H2.Utf8 (Standard.Character, Standard.Wide_Character); + +end H2.Wide; diff --git a/lib/lib.gpr.in b/lib/lib.gpr.in index 8ffa15e..c5a13b7 100644 --- a/lib/lib.gpr.in +++ b/lib/lib.gpr.in @@ -17,14 +17,16 @@ project Lib is "h2-scheme-execute.adb", "h2-scheme-token.adb", "h2-utf8.adb", - "h2-utf8.ads" + "h2-utf8.ads", + "h2-wide.ads" ); for Library_Interface use ( "h2", "h2.ascii", "h2.pool", "h2.scheme", - "h2.utf8" + "h2.utf8", + "h2.wide" ); package Compiler is