# Run this to generate Makefile, then run 'make'
EXAMPLES = {
    'minimum' : {'minimum'},
    'copy' : {'copy'},
    'loop' : {'loop', 'example_common'},
    'xorshift' : {'xorshift', 'example_common'},
}
EXAMPLE_OBJS = ['example_common', 'copy', 'loop',
                'minimum', 'xorshift']
OUTPUT = 'Makefile'

ofh = open(OUTPUT, 'w')

ofh.write('# Generated by config-examples.py\n\n')

ofh.write('all\t: ' + ' '.join(EXAMPLES) + '\n\n')

ofh.write('clean\t:\n')
ofh.write('\trm -f *.o\n')
ofh.write('\trm -f ' + ' '.join(EXAMPLES) + '\n')

for e in EXAMPLE_OBJS:
    ofh.write(e + '.o\t: ' + e + '.cpp\n')
    ofh.write('\tg++ -std=c++11 -Wall -g -I../src -c ' + e + '.cpp\n\n')

for k, v in EXAMPLES.iteritems():
    objs = []
    for o in v:
        objs.append(o + '.o')
    obj_lst = ' '.join(objs)
    ofh.write(k + '\t: ../libiroha.la ' + obj_lst + '\n')
    ofh.write('\t../libtool --tag=CXX --mode=link g++ -o ' + k + ' ' + obj_lst + ' ../libiroha.la\n')

print('Generated Makefile. Please run \'make\'')

@@ -1,8 +1,28 @@
+#! /usr/bin/python%0A%0A
 # Run th
@@ -845,24 +845,55 @@
 k + '%5Ct: ../
+src/out/Default/obj.target/src/
 libiroha.la 
@@ -889,17 +889,16 @@
 ibiroha.
-l
 a ' + ob
@@ -932,41 +932,8 @@
 ('%5Ct
-../libtool --tag=CXX --mode=link 
 g++ 
@@ -965,21 +965,76 @@
 + ' 
+-L
 ../
-libiroha.l
+src/out/Default/obj.target/src/ -liroha -lverilog_writer -liroh
 a%5Cn'

Fix up config-examples.py to link with .a file directly.