Skip to content
This repository
Browse code

preprocess in ./preprocess instead of make

  • Loading branch information...
commit 007e8db7132be415660d209ea21d8179693c52b2 1 parent edfc482
FURUHASHI Sadayuki authored
3  Makefile.am
@@ -45,6 +45,3 @@ man_MANS = \
45 45
 		doc/kumostat.1 \
46 46
 		doc/kumotop.1
47 47
 
48  
-prep:
49  
-	cd src && make prep
50  
-
6  bootstrap
@@ -36,7 +36,11 @@ test -f AUTHORS   || touch AUTHORS
36 36
 test -f COPYING   || touch COPYING
37 37
 test -f ChangeLog || touch ChangeLog
38 38
 test -f NEWS      || touch NEWS
39  
-test -f README    || touch README
  39
+test -f README    || cp -f README.md README
  40
+
  41
+if ! ./preprocess; then
  42
+	exit 1
  43
+fi
40 44
 
41 45
 
42 46
 ACLOCAL="aclocal"
25  configure.in
@@ -7,36 +7,11 @@ AC_CONFIG_HEADER(config.h)
7 7
 
8 8
 
9 9
 AC_SUBST(CFLAGS)
10  
-if test "" = "$CFLAGS"; then
11  
-	CFLAGS="-O4"
12  
-fi
13 10
 CFLAGS="-O4 -Wall $CFLAGS"
14 11
 
15  
-
16 12
 AC_SUBST(CXXFLAGS)
17  
-if test "" = "$CXXFLAGS"; then
18  
-	CXXFLAGS="-O4"
19  
-fi
20 13
 CXXFLAGS="-O4 -Wall $CXXFLAGS"
21 14
 
22  
-
23  
-AC_CHECK_PROG(RUBY, ruby, ruby)
24  
-if test "x$RUBY" = x; then
25  
-	AC_MSG_ERROR([cannot find ruby. Ruby is needed to build.])
26  
-fi
27  
-
28  
-AC_CHECK_PROG(ERB, erb, erb)
29  
-if test "x$ERB" = x; then
30  
-	AC_MSG_ERROR([cannot find erb. Ruby is needed to build.])
31  
-fi
32  
-
33  
-AC_CHECK_PROG(RAGEL, ragel, ragel)
34  
-if test "x$RAGEL" = x; then
35  
-	#AC_MSG_ERROR([cannot find ragel. Ragel is needed to build.])
36  
-	RAGEL=ragel
37  
-fi
38  
-
39  
-
40 15
 AC_PROG_CC
41 16
 AC_PROG_CXX
42 17
 
107  preprocess
... ...
@@ -0,0 +1,107 @@
  1
+#!/usr/bin/env bash
  2
+
  3
+RUBY="ruby"
  4
+ERB="erb"
  5
+RAGEL="ragel"
  6
+
  7
+function r() {
  8
+	echo "$@"
  9
+	"$@"
  10
+}
  11
+
  12
+function check_error() {
  13
+	if [ "$1" != 0 ]; then
  14
+		echo ""
  15
+		echo "** preprocess failed **"
  16
+		echo ""
  17
+		exit 1
  18
+	fi
  19
+}
  20
+
  21
+function pre_h() {
  22
+	file="$1"
  23
+	out="$(dirname "$file")/$(basename "$file" .pre.h).h"
  24
+	r "$RUBY" -e '
  25
+		def args(n, &block) ;
  26
+			Array.new(n) {|i| yield i+1} .join(", ") ;
  27
+		end ;
  28
+		src = File.read(ARGV[0]) ;
  29
+		src.gsub!(/^MP_ARGS_BEGIN$(.*?)^MP_ARGS_END$/m) {|code| ;
  30
+			result = [] ;
  31
+			1.upto(15) {|n| ;
  32
+				line = code.split("\n")[1..-2].join("\n") ;
  33
+				line.gsub!(/MP_ARGS_TEMPLATE/,   args(n) {|i| "typename A#{i}" }) ;
  34
+				line.gsub!(/MP_ARGS_PARAMS_PTR/, args(n) {|i| "A#{i}* a#{i}"   }) ;
  35
+				line.gsub!(/MP_ARGS_PARAMS_REF/, args(n) {|i| "A#{i}& a#{i}"   }) ;
  36
+				line.gsub!(/MP_ARGS_PARAMS/,     args(n) {|i| "A#{i} a#{i}"    }) ;
  37
+				line.gsub!(/MP_ARGS_FUNC/,       args(n) {|i| "a#{i}"          }) ;
  38
+				line.gsub!(/MP_ARGS_TYPES_PTR/,  args(n) {|i| "A#{i}*"    }) ;
  39
+				line.gsub!(/MP_ARGS_TYPES_REF/,  args(n) {|i| "A#{i}&"    }) ;
  40
+				line.gsub!(/MP_ARGS_TYPES/,      args(n) {|i| "A#{i}"     }) ;
  41
+				line.gsub!(/MP_ARGS_ITERATOR_BEGIN$(.*?)^MP_ARGS_ITERATOR_END$/m) {|sub| ;
  42
+					subresult = [] ;
  43
+					subline = sub.split("\n")[1..-2].join("\n") ;
  44
+					1.upto(n) {|it| ;
  45
+						sublineit = subline.dup ;
  46
+						sublineit.gsub!(/MP_ARGS_ITERATOR_PARAM/,    "a#{it}") ;
  47
+						sublineit.gsub!(/MP_ARGS_ITERATOR_TYPE_PTR/, "A#{it}*") ;
  48
+						sublineit.gsub!(/MP_ARGS_ITERATOR_TYPE_REF/, "A#{it}&") ;
  49
+						sublineit.gsub!(/MP_ARGS_ITERATOR_TYPE/,     "A#{it}") ;
  50
+						sublineit.gsub!(/\[MP_ARGS_ITERATOR\]/,      "#{it}" ) ;
  51
+						if it == 1 ;
  52
+							sublineit.gsub!(/MP_ARGS_ITERATOR_FIRST_COLON/, " " ) ;
  53
+						else ;
  54
+							sublineit.gsub!(/MP_ARGS_ITERATOR_FIRST_COLON/, "," ) ;
  55
+						end ;
  56
+						if it == n ;
  57
+							sublineit.gsub!(/MP_ARGS_ITERATOR_LAST_COLON/, " " ) ;
  58
+						else ;
  59
+							sublineit.gsub!(/MP_ARGS_ITERATOR_LAST_COLON/, "," ) ;
  60
+						end ;
  61
+						subresult << sublineit ;
  62
+					} ;
  63
+					subresult.join("\n") ;
  64
+				} ;
  65
+				result << line ;
  66
+			} ;
  67
+			result.join("\n") ;
  68
+		} ;
  69
+		File.open(ARGV[1],"w") {|f| f.puts src }' "$file" "$out"
  70
+	check_error $?
  71
+}
  72
+
  73
+function pre_erb() {
  74
+	file="$1"
  75
+	out="$(dirname "$file")/$(basename "$file" .erb)"
  76
+	echo "$ERB" "<" "$file" ">" "$out"
  77
+	"$ERB" < "$file" > "$out"
  78
+	check_error $?
  79
+}
  80
+
  81
+pre_h src/mp/object_callback.pre.h
  82
+pre_h src/mp/wavy/core.pre.h
  83
+pre_h src/mp/wavy/singleton.pre.h
  84
+
  85
+pre_erb src/log/mlogger.h.erb
  86
+pre_erb src/log/logpack.hpp.erb
  87
+
  88
+r "$RAGEL" -C src/gate/memproto/memtext.rl -o src/gate/memproto/memtext.c
  89
+check_error $?
  90
+
  91
+cwd="$(pwd)"
  92
+
  93
+echo "cd $cwd/src/logic/gateway"
  94
+cd src/logic/gateway && r "$RUBY" "$cwd/src/logic/protogen" ../gateway.proto.h
  95
+check_error $?
  96
+cd "$cwd"
  97
+
  98
+echo "cd $cwd/src/logic/manager"
  99
+cd src/logic/manager && r "$RUBY" "$cwd/src/logic/protogen" ../manager.proto.h
  100
+check_error $?
  101
+cd "$cwd"
  102
+
  103
+echo "cd $cwd/src/logic/server"
  104
+cd src/logic/server && r "$RUBY" "$cwd/src/logic/protogen" ../server.proto.h
  105
+check_error $?
  106
+cd "$cwd"
  107
+
6  src/Makefile.am
... ...
@@ -1,10 +1,4 @@
1  
-export ERB
2  
-export RUBY
3  
-export RAGEL
4 1
 export REVISION
5 2
 
6 3
 SUBDIRS = mp mpsrc log kazuhiki rpc storage gate logic command
7 4
 
8  
-prep:
9  
-	cd gate && make prep
10  
-
4  src/gate/Makefile.am
@@ -18,10 +18,6 @@ noinst_HEADERS = \
18 18
 		memcache_text.h \
19 19
 		cloudy.h
20 20
 
21  
-prep: memproto/memtext.rl
22  
-	$(RAGEL) -C $< -o memproto/memtext.c.tmp
23  
-	mv memproto/memtext.c.tmp memproto/memtext.c
24  
-
25 21
 EXTRA_DIST = \
26 22
 		memproto/memtext.rl
27 23
 
84  src/gate/memproto/memtext.c
... ...
@@ -1,5 +1,5 @@
1 1
 
2  
-#line 1 "memproto/memtext.rl"
  2
+#line 1 "src/gate/memproto/memtext.rl"
3 3
 /*
4 4
  * memtext
5 5
  *
@@ -56,12 +56,12 @@
56 56
 	TYPE NAME = ((TYPE*)(&ctx->callback))[ctx->command]
57 57
 
58 58
 
59  
-#line 307 "memproto/memtext.rl"
  59
+#line 307 "src/gate/memproto/memtext.rl"
60 60
 
61 61
 
62 62
 
63 63
 
64  
-#line 65 "memproto/memtext.c.tmp"
  64
+#line 65 "src/gate/memproto/memtext.c"
65 65
 static const char _memtext_actions[] = {
66 66
 	0, 1, 0, 1, 1, 1, 2, 1, 
67 67
 	4, 1, 5, 1, 6, 1, 7, 1, 
@@ -290,20 +290,20 @@ static const int memtext_en_main = 1;
290 290
 static const int memtext_en_data = 130;
291 291
 
292 292
 
293  
-#line 311 "memproto/memtext.rl"
  293
+#line 311 "src/gate/memproto/memtext.rl"
294 294
 
295 295
 void memtext_init(memtext_parser* ctx, memtext_callback* callback, void* user)
296 296
 {
297 297
 	int cs = 0;
298 298
 	int top = 0;
299 299
 	
300  
-#line 301 "memproto/memtext.c.tmp"
  300
+#line 301 "src/gate/memproto/memtext.c"
301 301
 	{
302 302
 	cs = memtext_start;
303 303
 	top = 0;
304 304
 	}
305 305
 
306  
-#line 317 "memproto/memtext.rl"
  306
+#line 317 "src/gate/memproto/memtext.rl"
307 307
 	memset(ctx, 0, sizeof(memtext_parser));
308 308
 	ctx->cs = cs;
309 309
 	ctx->callback = *callback;
@@ -333,7 +333,7 @@ int memtext_execute(memtext_parser* ctx, const char* data, size_t len, size_t* o
333 333
 	//printf("\n");
334 334
 
335 335
 	
336  
-#line 337 "memproto/memtext.c.tmp"
  336
+#line 337 "src/gate/memproto/memtext.c"
337 337
 	{
338 338
 	int _klen;
339 339
 	unsigned int _trans;
@@ -408,7 +408,7 @@ int memtext_execute(memtext_parser* ctx, const char* data, size_t len, size_t* o
408 408
 		switch ( *_acts++ )
409 409
 		{
410 410
 	case 0:
411  
-#line 59 "memproto/memtext.rl"
  411
+#line 59 "src/gate/memproto/memtext.rl"
412 412
 	{
413 413
 		ctx->keys = 0;
414 414
 		ctx->noreply = false;
@@ -416,19 +416,19 @@ int memtext_execute(memtext_parser* ctx, const char* data, size_t len, size_t* o
416 416
 	}
417 417
 	break;
418 418
 	case 1:
419  
-#line 65 "memproto/memtext.rl"
  419
+#line 65 "src/gate/memproto/memtext.rl"
420 420
 	{
421 421
 		MARK(key_pos[ctx->keys], p);
422 422
 	}
423 423
 	break;
424 424
 	case 2:
425  
-#line 68 "memproto/memtext.rl"
  425
+#line 68 "src/gate/memproto/memtext.rl"
426 426
 	{
427 427
 		SET_MARK_LEN(key_len[ctx->keys], key_pos[ctx->keys], p);
428 428
 	}
429 429
 	break;
430 430
 	case 3:
431  
-#line 71 "memproto/memtext.rl"
  431
+#line 71 "src/gate/memproto/memtext.rl"
432 432
 	{
433 433
 		++ctx->keys;
434 434
 		if(ctx->keys > MEMTEXT_MAX_MULTI_GET) {
@@ -437,61 +437,61 @@ int memtext_execute(memtext_parser* ctx, const char* data, size_t len, size_t* o
437 437
 	}
438 438
 	break;
439 439
 	case 4:
440  
-#line 78 "memproto/memtext.rl"
  440
+#line 78 "src/gate/memproto/memtext.rl"
441 441
 	{
442 442
 		MARK(flags, p);
443 443
 	}
444 444
 	break;
445 445
 	case 5:
446  
-#line 81 "memproto/memtext.rl"
  446
+#line 81 "src/gate/memproto/memtext.rl"
447 447
 	{
448 448
 		SET_UINT(flags, flags, p);
449 449
 	}
450 450
 	break;
451 451
 	case 6:
452  
-#line 85 "memproto/memtext.rl"
  452
+#line 85 "src/gate/memproto/memtext.rl"
453 453
 	{
454 454
 		MARK(exptime, p);
455 455
 	}
456 456
 	break;
457 457
 	case 7:
458  
-#line 88 "memproto/memtext.rl"
  458
+#line 88 "src/gate/memproto/memtext.rl"
459 459
 	{
460 460
 		SET_UINT(exptime, exptime, p);
461 461
 	}
462 462
 	break;
463 463
 	case 8:
464  
-#line 92 "memproto/memtext.rl"
  464
+#line 92 "src/gate/memproto/memtext.rl"
465 465
 	{
466 466
 		MARK(bytes, p);
467 467
 	}
468 468
 	break;
469 469
 	case 9:
470  
-#line 95 "memproto/memtext.rl"
  470
+#line 95 "src/gate/memproto/memtext.rl"
471 471
 	{
472 472
 		SET_UINT(bytes, bytes, p);
473 473
 	}
474 474
 	break;
475 475
 	case 10:
476  
-#line 99 "memproto/memtext.rl"
  476
+#line 99 "src/gate/memproto/memtext.rl"
477 477
 	{
478 478
 		ctx->noreply = true;
479 479
 	}
480 480
 	break;
481 481
 	case 11:
482  
-#line 103 "memproto/memtext.rl"
  482
+#line 103 "src/gate/memproto/memtext.rl"
483 483
 	{
484 484
 		MARK(cas_unique, p);
485 485
 	}
486 486
 	break;
487 487
 	case 12:
488  
-#line 106 "memproto/memtext.rl"
  488
+#line 106 "src/gate/memproto/memtext.rl"
489 489
 	{
490 490
 		SET_ULL(cas_unique, cas_unique, p);
491 491
 	}
492 492
 	break;
493 493
 	case 13:
494  
-#line 110 "memproto/memtext.rl"
  494
+#line 110 "src/gate/memproto/memtext.rl"
495 495
 	{
496 496
 		MARK(data_pos, p+1);
497 497
 		ctx->data_count = ctx->bytes;
@@ -499,7 +499,7 @@ int memtext_execute(memtext_parser* ctx, const char* data, size_t len, size_t* o
499 499
 	}
500 500
 	break;
501 501
 	case 14:
502  
-#line 115 "memproto/memtext.rl"
  502
+#line 115 "src/gate/memproto/memtext.rl"
503 503
 	{
504 504
 		if(--ctx->data_count == 0) {
505 505
 			//printf("mark %d\n", ctx->data_pos);
@@ -511,55 +511,55 @@ int memtext_execute(memtext_parser* ctx, const char* data, size_t len, size_t* o
511 511
 	}
512 512
 	break;
513 513
 	case 15:
514  
-#line 126 "memproto/memtext.rl"
  514
+#line 126 "src/gate/memproto/memtext.rl"
515 515
 	{ ctx->command = MEMTEXT_CMD_GET;     }
516 516
 	break;
517 517
 	case 16:
518  
-#line 127 "memproto/memtext.rl"
  518
+#line 127 "src/gate/memproto/memtext.rl"
519 519
 	{ ctx->command = MEMTEXT_CMD_GETS;    }
520 520
 	break;
521 521
 	case 17:
522  
-#line 128 "memproto/memtext.rl"
  522
+#line 128 "src/gate/memproto/memtext.rl"
523 523
 	{ ctx->command = MEMTEXT_CMD_SET;     }
524 524
 	break;
525 525
 	case 18:
526  
-#line 129 "memproto/memtext.rl"
  526
+#line 129 "src/gate/memproto/memtext.rl"
527 527
 	{ ctx->command = MEMTEXT_CMD_ADD;     }
528 528
 	break;
529 529
 	case 19:
530  
-#line 130 "memproto/memtext.rl"
  530
+#line 130 "src/gate/memproto/memtext.rl"
531 531
 	{ ctx->command = MEMTEXT_CMD_REPLACE; }
532 532
 	break;
533 533
 	case 20:
534  
-#line 131 "memproto/memtext.rl"
  534
+#line 131 "src/gate/memproto/memtext.rl"
535 535
 	{ ctx->command = MEMTEXT_CMD_APPEND;  }
536 536
 	break;
537 537
 	case 21:
538  
-#line 132 "memproto/memtext.rl"
  538
+#line 132 "src/gate/memproto/memtext.rl"
539 539
 	{ ctx->command = MEMTEXT_CMD_PREPEND; }
540 540
 	break;
541 541
 	case 22:
542  
-#line 133 "memproto/memtext.rl"
  542
+#line 133 "src/gate/memproto/memtext.rl"
543 543
 	{ ctx->command = MEMTEXT_CMD_CAS;     }
544 544
 	break;
545 545
 	case 23:
546  
-#line 134 "memproto/memtext.rl"
  546
+#line 134 "src/gate/memproto/memtext.rl"
547 547
 	{ ctx->command = MEMTEXT_CMD_DELETE;  }
548 548
 	break;
549 549
 	case 24:
550  
-#line 135 "memproto/memtext.rl"
  550
+#line 135 "src/gate/memproto/memtext.rl"
551 551
 	{ ctx->command = MEMTEXT_CMD_INCR;    }
552 552
 	break;
553 553
 	case 25:
554  
-#line 136 "memproto/memtext.rl"
  554
+#line 136 "src/gate/memproto/memtext.rl"
555 555
 	{ ctx->command = MEMTEXT_CMD_DECR;    }
556 556
 	break;
557 557
 	case 26:
558  
-#line 137 "memproto/memtext.rl"
  558
+#line 137 "src/gate/memproto/memtext.rl"
559 559
 	{ ctx->command = MEMTEXT_CMD_VERSION; }
560 560
 	break;
561 561
 	case 27:
562  
-#line 140 "memproto/memtext.rl"
  562
+#line 140 "src/gate/memproto/memtext.rl"
563 563
 	{
564 564
 		unsigned int i;
565 565
 		++ctx->keys;
@@ -580,7 +580,7 @@ int memtext_execute(memtext_parser* ctx, const char* data, size_t len, size_t* o
580 580
 	}
581 581
 	break;
582 582
 	case 28:
583  
-#line 159 "memproto/memtext.rl"
  583
+#line 159 "src/gate/memproto/memtext.rl"
584 584
 	{
585 585
 		CALLBACK(cb, memtext_callback_storage);
586 586
 		if(cb) {
@@ -598,7 +598,7 @@ int memtext_execute(memtext_parser* ctx, const char* data, size_t len, size_t* o
598 598
 	}
599 599
 	break;
600 600
 	case 29:
601  
-#line 175 "memproto/memtext.rl"
  601
+#line 175 "src/gate/memproto/memtext.rl"
602 602
 	{
603 603
 		CALLBACK(cb, memtext_callback_cas);
604 604
 		if(cb) {
@@ -617,7 +617,7 @@ int memtext_execute(memtext_parser* ctx, const char* data, size_t len, size_t* o
617 617
 	}
618 618
 	break;
619 619
 	case 30:
620  
-#line 192 "memproto/memtext.rl"
  620
+#line 192 "src/gate/memproto/memtext.rl"
621 621
 	{
622 622
 		CALLBACK(cb, memtext_callback_delete);
623 623
 		if(cb) {
@@ -632,7 +632,7 @@ int memtext_execute(memtext_parser* ctx, const char* data, size_t len, size_t* o
632 632
 	}
633 633
 	break;
634 634
 	case 31:
635  
-#line 205 "memproto/memtext.rl"
  635
+#line 205 "src/gate/memproto/memtext.rl"
636 636
 	{
637 637
 		CALLBACK(cb, memtext_callback_numeric);
638 638
 		if(cb) {
@@ -647,7 +647,7 @@ int memtext_execute(memtext_parser* ctx, const char* data, size_t len, size_t* o
647 647
 	}
648 648
 	break;
649 649
 	case 32:
650  
-#line 218 "memproto/memtext.rl"
  650
+#line 218 "src/gate/memproto/memtext.rl"
651 651
 	{
652 652
 		CALLBACK(cb, memtext_callback_other);
653 653
 		if(cb) {
@@ -658,7 +658,7 @@ int memtext_execute(memtext_parser* ctx, const char* data, size_t len, size_t* o
658 658
 		} else { goto convert_error; }
659 659
 	}
660 660
 	break;
661  
-#line 662 "memproto/memtext.c.tmp"
  661
+#line 662 "src/gate/memproto/memtext.c"
662 662
 		}
663 663
 	}
664 664
 
@@ -671,7 +671,7 @@ int memtext_execute(memtext_parser* ctx, const char* data, size_t len, size_t* o
671 671
 	_out: {}
672 672
 	}
673 673
 
674  
-#line 346 "memproto/memtext.rl"
  674
+#line 346 "src/gate/memproto/memtext.rl"
675 675
 
676 676
 ret:
677 677
 	ctx->cs = cs;
19  src/log/Makefile.am
... ...
@@ -1,7 +1,4 @@
1 1
 
2  
-nodist_noinst_DATA = mlogger.h
3  
-dist_noinst_DATA = mlogger.h.erb
4  
-
5 2
 noinst_LIBRARIES = libkumo_log.a
6 3
 
7 4
 libkumo_log_a_SOURCES = \
@@ -13,17 +10,6 @@ libkumo_log_a_SOURCES = \
13 10
 		logpack.c \
14 11
 		logpacker.cc
15 12
 
16  
-# FIXME GNU make extension
17  
-%.h: %.h.erb
18  
-	$(ERB) < $< > $@.tmp
19  
-	mv $@.tmp $@
20  
-
21  
-%.hpp: %.hpp.erb
22  
-	$(ERB) < $< > $@.tmp
23  
-	mv $@.tmp $@
24  
-
25  
-MOSTLYCLEANFILES = mlogger.h logpack.hpp
26  
-
27 13
 noinst_HEADERS = \
28 14
 		mlogger.h \
29 15
 		mlogger_null.h \
@@ -34,5 +20,8 @@ noinst_HEADERS = \
34 20
 		logpack.hpp \
35 21
 		logpacker.h
36 22
 
37  
-$(libkumo_log_a_SOURCES): mlogger.h logpack.hpp
  23
+EXTRA_DIST = \
  24
+		mlogger.h.erb \
  25
+		logpack.hpp.erb
  26
+
38 27
 
4  src/logic/Makefile.am
... ...
@@ -1,8 +1,4 @@
1  
-export ERB
2  
-export RUBY
3  
-export RAGEL
4 1
 
5  
-# work around for dependency
6 2
 SUBDIRS = manager server gateway
7 3
 
8 4
 noinst_LIBRARIES = libkumo_logic.a
12  src/logic/gateway/Makefile.am
@@ -3,16 +3,6 @@ PROTOGEN_AUTOGEN_FILES = \
3 3
 		proto.h \
4 4
 		mod_network.h
5 5
 
6  
-proto.generated: ../protogen ../gateway.proto.h
7  
-	$(RUBY) ../protogen ../gateway.proto.h
8  
-	touch $@
9  
-
10  
-$(PROTOGEN_AUTOGEN_FILES): proto.generated
11  
-
12  
-nodist_noinst_HEADERS = \
  6
+EXTRA_DIST = \
13 7
 		$(PROTOGEN_AUTOGEN_FILES)
14 8
 
15  
-MOSTLYCLEANFILES = \
16  
-		$(PROTOGEN_AUTOGEN_FILES) \
17  
-		proto.generated
18  
-
12  src/logic/manager/Makefile.am
@@ -5,16 +5,6 @@ PROTOGEN_AUTOGEN_FILES = \
5 5
 		mod_network.h \
6 6
 		mod_replace.h
7 7
 
8  
-proto.generated: ../protogen ../manager.proto.h
9  
-	$(RUBY) ../protogen ../manager.proto.h
10  
-	touch $@
11  
-
12  
-$(PROTOGEN_AUTOGEN_FILES): proto.generated
13  
-
14  
-nodist_noinst_HEADERS = \
  8
+EXTRA_DIST = \
15 9
 		$(PROTOGEN_AUTOGEN_FILES)
16 10
 
17  
-MOSTLYCLEANFILES = \
18  
-		$(PROTOGEN_AUTOGEN_FILES) \
19  
-		proto.generated
20  
-
12  src/logic/server/Makefile.am
@@ -7,16 +7,6 @@ PROTOGEN_AUTOGEN_FILES = \
7 7
 		mod_replace_stream.h \
8 8
 		mod_store.h
9 9
 
10  
-proto.generated: ../protogen ../server.proto.h
11  
-	$(RUBY) ../protogen ../server.proto.h
12  
-	touch $@
13  
-
14  
-$(PROTOGEN_AUTOGEN_FILES): proto.generated
15  
-
16  
-nodist_noinst_HEADERS = \
  10
+EXTRA_DIST = \
17 11
 		$(PROTOGEN_AUTOGEN_FILES)
18 12
 
19  
-MOSTLYCLEANFILES = \
20  
-		$(PROTOGEN_AUTOGEN_FILES) \
21  
-		proto.generated
22  
-
100  src/mp/Makefile.am
... ...
@@ -1,82 +1,26 @@
1 1
 
2  
-NEED_PREPROCESS = \
3  
-		object_callback.h \
4  
-		wavy/core.h \
5  
-		wavy/singleton.h
6  
-
7  
-MOSTLYCLEANFILES = $(NEED_PREPROCESS)
8  
-
9  
-EXTRA_DIST = $(NEED_PREPROCESS)
  2
+EXTRA_DIST = \
  3
+		object_callback.pre.h \
  4
+		wavy/core.pre.h \
  5
+		wavy/singleton.pre.h
10 6
 
11 7
 noinst_HEADERS = \
12  
-	exception.h \
13  
-	functional.h \
14  
-	memory.h \
15  
-	object_callback.h \
16  
-	pp.h \
17  
-	pthread.h \
18  
-	pthread_impl.h \
19  
-	shared_buffer.h \
20  
-	shared_buffer_impl.h \
21  
-	source.h \
22  
-	source_impl.h \
23  
-	stream_buffer.h \
24  
-	stream_buffer_impl.h \
25  
-	utility.h \
26  
-	wavy/core.h \
27  
-	wavy/output.h \
28  
-	wavy/singleton.h \
29  
-	wavy.h
30  
-
31  
-# FIXME GNU make extension
32  
-%.h: %.pre.h
33  
-	$(RUBY) -e '\
34  
-		def args(n, &block) ;\
35  
-			Array.new(n) {|i| yield i+1} .join(", ") ;\
36  
-		end ;\
37  
-		src = ARGF.read ;\
38  
-		src.gsub!(/^MP_ARGS_BEGIN$$(.*?)^MP_ARGS_END$$/m) {|code| ;\
39  
-			result = [] ;\
40  
-			1.upto(15) {|n| ;\
41  
-				line = code.split("\n")[1..-2].join("\n") ;\
42  
-				line.gsub!(/MP_ARGS_TEMPLATE/,   args(n) {|i| "typename A#{i}" }) ;\
43  
-				line.gsub!(/MP_ARGS_PARAMS_PTR/, args(n) {|i| "A#{i}* a#{i}"   }) ;\
44  
-				line.gsub!(/MP_ARGS_PARAMS_REF/, args(n) {|i| "A#{i}& a#{i}"   }) ;\
45  
-				line.gsub!(/MP_ARGS_PARAMS/,     args(n) {|i| "A#{i} a#{i}"    }) ;\
46  
-				line.gsub!(/MP_ARGS_FUNC/,       args(n) {|i| "a#{i}"          }) ;\
47  
-				line.gsub!(/MP_ARGS_TYPES_PTR/,  args(n) {|i| "A#{i}*"    }) ;\
48  
-				line.gsub!(/MP_ARGS_TYPES_REF/,  args(n) {|i| "A#{i}&"    }) ;\
49  
-				line.gsub!(/MP_ARGS_TYPES/,      args(n) {|i| "A#{i}"     }) ;\
50  
-				line.gsub!(/MP_ARGS_ITERATOR_BEGIN$$(.*?)^MP_ARGS_ITERATOR_END$$/m) {|sub| ;\
51  
-					subresult = [] ;\
52  
-					subline = sub.split("\n")[1..-2].join("\n") ;\
53  
-					1.upto(n) {|it| ;\
54  
-						sublineit = subline.dup ;\
55  
-						sublineit.gsub!(/MP_ARGS_ITERATOR_PARAM/,    "a#{it}") ;\
56  
-						sublineit.gsub!(/MP_ARGS_ITERATOR_TYPE_PTR/, "A#{it}*") ;\
57  
-						sublineit.gsub!(/MP_ARGS_ITERATOR_TYPE_REF/, "A#{it}&") ;\
58  
-						sublineit.gsub!(/MP_ARGS_ITERATOR_TYPE/,     "A#{it}") ;\
59  
-						sublineit.gsub!(/\[MP_ARGS_ITERATOR\]/,      "#{it}" ) ;\
60  
-						if it == 1 ;\
61  
-							sublineit.gsub!(/MP_ARGS_ITERATOR_FIRST_COLON/, " " ) ;\
62  
-						else ;\
63  
-							sublineit.gsub!(/MP_ARGS_ITERATOR_FIRST_COLON/, "," ) ;\
64  
-						end ;\
65  
-						if it == n ;\
66  
-							sublineit.gsub!(/MP_ARGS_ITERATOR_LAST_COLON/, " " ) ;\
67  
-						else ;\
68  
-							sublineit.gsub!(/MP_ARGS_ITERATOR_LAST_COLON/, "," ) ;\
69  
-						end ;\
70  
-						subresult << sublineit ;\
71  
-					} ;\
72  
-					subresult.join("\n") ;\
73  
-				} ;\
74  
-				result << line ;\
75  
-			} ;\
76  
-			result.join("\n") ;\
77  
-		} ;\
78  
-		puts src' \
79  
-	$< > $@.tmp
80  
-	mv $@.tmp $@
81  
-
  8
+		exception.h \
  9
+		functional.h \
  10
+		memory.h \
  11
+		object_callback.h \
  12
+		pp.h \
  13
+		pthread.h \
  14
+		pthread_impl.h \
  15
+		shared_buffer.h \
  16
+		shared_buffer_impl.h \
  17
+		source.h \
  18
+		source_impl.h \
  19
+		stream_buffer.h \
  20
+		stream_buffer_impl.h \
  21
+		utility.h \
  22
+		wavy/core.h \
  23
+		wavy/output.h \
  24
+		wavy/singleton.h \
  25
+		wavy.h
82 26
 

0 notes on commit 007e8db

Please sign in to comment.
Something went wrong with that request. Please try again.