forked from breed/elfsh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·1225 lines (1064 loc) · 44.7 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/sh
#
# Homemade configure file for the ERESI project
# The ERESI team 2001-2010
#
# $Id$
CHOSENBIT="0"
STATIC="0"
READLN="0"
KERNSH="0"
ERESI_NET="0"
LIBMJOLLNIR="1"
TESTING="0"
GSTABS=""
PREFIX=""
OSVER=`uname -r | cut -d "." -f1`
OSNAME=`uname -s`
CONFIGFILE="config.h"
VARSFILE="librevm/include/revm-vars.h"
LIBVARSFILE="libelfsh/include/libvars.h"
LPTHREAD="-lpthread"
SHELL=`which bash`
GENTOO=` uname -a | grep gentoo`
printHelp()
{
echo "Error: you MUST specify --enable-32, --enable-64 OR --enable-32-64."
echo
echo " Available parameters :"
echo
echo " --enable-32-64 : Build both ELF32/64 capable shell."
echo " --enable-32 : Build a ELF32 capable shell."
echo " --enable-64 : Build a ELF64 capable shell."
echo " --enable-readline : Link with readline"
echo " --enable-network : Build eresi server capability"
echo " --enable-static : Link in static."
echo " --enable-testing : Test ERESI without install"
echo " --enable-dmalloc : Link with Electric Fence."
echo " --enable-m64 : Build ELFsh itself as 64bits binary (default: 32bits)"
echo " --enable-gstabs+ : Enable gstabs+ support"
echo " --enable-kernsh : Build kernsh and libkernsh (linux only)"
echo " --enable-ke2dbg : Build ke2dbg kernel debugger (linux only)"
echo " --use-etags : Use etags"
echo " --use-ctags : Use ctags"
echo " --use-cpp : Build the project as C++"
echo " --no-stackprot : Use -fno-stack-protector gcc option"
echo
echo " --libasm-ia32 : Enable libasm INTEL engine"
echo " --libasm-sparc : Enable libasm SPARC engine"
echo " --libasm-mips : Enable libasm MIPS engine"
echo " --libasm-arm : Enable libasm ARM engine"
echo " --libasm-packed : Pack handlers in a single file"
echo " --libasm-unpacked : Keep handlers per source file"
echo
echo " Available variables :"
echo
echo " --set-shell : Set your UNIX shell path."
echo " --set-compiler : Set your compiler path."
echo " --set-editor : Set your editor path."
echo " --set-modpath : Set your ELFsh modules path."
echo " --prefix <path> : Set prefix."
echo
echo " All options are disabled by default."
echo
exit 1
}
if [ "$1" = "-h" -o "$1" = "--help" ] ; then
printHelp
fi
echo > $LIBVARSFILE
echo > $VARSFILE
echo > $CONFIGFILE
echo "CFLAGS32 += -Wall " >> $CONFIGFILE
echo "CFLAGS64 += -Wall " >> $CONFIGFILE
while [ $# -ne 0 ]; do
case "$1" in
--enable-32-64*)
if [ $CHOSENBIT = "1" ]; then
echo
echo "Error: enable-32 and enable-64 are incompatible"
echo "Use --enable-32-64 if you know what you are doing"
echo
rm -f $CONFIGFILE
exit
fi
echo " [*] Enabling ELF64/ELF32 support"
#BITS="-DERESI64"
#echo "//#define ELFSH64 1" >> $LIBVARSFILE
CHOSENBIT="1"
BUILD_TARGET=""
;;
--enable-64*)
if [ $CHOSENBIT = "1" ]; then
echo
echo "Error: enable-32 and enable-64 are incompatible."
echo
rm -f $CONFIGFILE
exit
fi
echo " [*] Enabling ELF64 support"
#BITS="-DERESI64"
#echo "//#define ELFSH64 1" >> $LIBVARSFILE
CHOSENBIT="1"
BUILD_TARGET=all64
MOD_TARGET=mod64
;;
--enable-32*)
if [ $CHOSENBIT = "1" ]; then
echo
echo "Error: enable-32 and enable-64 are incompatible."
echo
rm -f $CONFIGFILE
exit
fi
echo " [*] Enabling ELF32 support"
#BITS="-DERESI32"
echo "//#define ELFSH32 1" >> $LIBVARSFILE
CHOSENBIT="1"
BUILD_TARGET=all32
MOD_TARGET=mod32
;;
--enable-network*)
echo " [*] Enable ERESI client/server capability"
ERESI_NET="1"
echo "LDDUMPOPT32 = -ldump32" >> $CONFIGFILE
echo "LDDUMPOBJ32 = ../libdump/libdump32.o" >> $CONFIGFILE
echo "LDDUMPOPT64 = -ldump64" >> $CONFIGFILE
echo "LDDUMPOBJ64 = ../libdump/libdump64.o" >> $CONFIGFILE
BITS=$BITS" -DERESI_NET"
;;
--libasm-ia32)
echo " [*] Libasm IA32 engine"
echo "LIBASM_ENABLE_IA32 = 1" >> $CONFIGFILE
echo "CFLAGS_libasm += -DLIBASM_ENABLE_IA32=1" >> $CONFIGFILE
LIBASM_ENABLE_CHOOSEN=1
;;
--libasm-sparc)
echo " [*] Libasm SPARC engine"
echo "LIBASM_ENABLE_SPARC = 1" >> $CONFIGFILE
echo "CFLAGS_libasm += -DLIBASM_ENABLE_SPARC=1" >> $CONFIGFILE
LIBASM_ENABLE_CHOOSEN=1
;;
--libasm-mips)
echo " [*] Libasm MIPS engine"
echo "LIBASM_ENABLE_MIPS = 1" >> $CONFIGFILE
echo "CFLAGS_libasm += -DLIBASM_ENABLE_MIPS=1" >> $CONFIGFILE
LIBASM_ENABLE_CHOOSEN=1
;;
--libasm-arm)
echo " [*] Libasm ARM engine"
echo "LIBASM_ENABLE_ARM = 1" >> $CONFIGFILE
echo "CFLAGS_libasm += -DLIBASM_ENABLE_ARM=1" >> $CONFIGFILE
LIBASM_ENABLE_CHOOSEN=1
;;
--libasm-packed)
LIBASM_PACKED_HANDLERS=1
;;
--libasm-unpacked)
LIBASM_PACKED_HANDLERS=0
;;
--enable-testing*)
echo " [*] Enable compilation without install"
echo "#define E2DBG_PATH " \"`pwd`/libe2dbg/\" >> $VARSFILE
echo "EXTRACFLAGS += -g3" >> $CONFIGFILE
TESTING="1"
;;
--enable-readline*)
echo " [*] Enabling readline support"
READLN="1"
if [ -z "$GENTOO" ] ; then
TERMCAP="-ltermcap"
else
TERMCAP=""
fi
if [ "${OSNAME}" != OpenBSD ] ; then
echo "READLN = 1" >> $CONFIGFILE
echo "READLNOPT = -DUSE_READLN" >> $CONFIGFILE
echo "LDREADLNOPT = -L/opt/sfw/lib/ -lreadline $TERMCAP" >> $CONFIGFILE
else
echo "LDREADLNOPT = -lreadline $TERMCAP" >> $CONFIGFILE
fi
echo "LDUIOPT32 = -L../libui -lui32" >> $CONFIGFILE
echo "LDUIOPT64 = -L../libui -lui64" >> $CONFIGFILE
;;
--enable-ncurses*)
echo " [*] Enabling ncurses support"
READLN="1"
echo "NCURSESLNOPT = -DUSE_UI" >> $CONFIGFILE
echo "LDNCURSESLNOPT = -lncurses" >> $CONFIGFILE
;;
--enable-termcap*)
echo " [*] Enabling termcap support"
TERMCAP="1"
echo "LDREADLNOPT += -ltermcap" >> $CONFIGFILE
;;
--enable-static*)
echo " [*] Enabling static linking"
echo "STATOPT = -static" >> $CONFIGFILE
echo "STATOPT2 = -DUSE_STATIC" >> $CONFIGFILE
STATIC="1"
;;
--enable-dmalloc*)
echo " [*] Enabling dmalloc linking"
echo "EXTRAOPT = $EXTRAOPT -ldmalloc" >> $CONFIGFILE
;;
--enable-m64*)
echo " [*] Enabling ELFsh 64bits binary built"
echo "BUILDOPT = -m64 -DM64" >> $CONFIGFILE
M64="1"
;;
--enable-gstabs*)
echo " [*] Enabling gstabs+ support"
echo "GSTABS = -gstabs+" >> $CONFIGFILE
GSTABS="1"
;;
--use-etags*)
echo " [*] Enabling etags support"
ETAGS="1"
;;
--use-ctags*)
echo " [*] Enabling etags support"
CTAGS="1"
;;
--use-cpp*)
echo " [*] Enabling C++ built"
echo "CC = g++" >> $CONFIGFILE
;;
--no-stackprot*)
echo " [*] Disabling gcc stack protection"
echo "EXTRACFLAGS += -fno-stack-protector" >> $CONFIGFILE
;;
--set-shell*)
shift
echo " [*] Setting UNIX shell to " $1
echo "#define ERESI_EXTSHELL " \"$1\" >> $VARSFILE
SHELLSET="1"
;;
--set-editor*)
shift
echo " [*] Setting editor to " $1
echo "#define ERESI_EDITOR " \"$1\" >> $VARSFILE
EDITORSET="1"
;;
--set-compiler*)
shift
echo " [*] Setting compiler to " $1
echo "CC = " $1 >> $CONFIGFILE
COMPILERSET="1"
;;
--set-modpath*)
shift
echo " [*] Setting ELFsh modules path to " $1
echo "#define ERESI_MODPATH " \"$1\" >> $VARSFILE
MODPATHSET="1"
;;
--set-lib-path*)
shift
echo " [*] Setting ELFsh library search path to " $1
echo "#define ERESI_LIBPATH " \"$1\" >> $VARSFILE
LIBPATHSET="1"
;;
--enable-stripped-log*)
shift
echo " [*] Enable stripped log"
echo "#define ERESI_SLOG 1" >> $VARSFILE
SLOGSET="1";
;;
--enable-kernsh*)
echo " [*] Enabling kernsh and libkernsh"
if [ -e "$(which uname)" ] ; then
arch=`uname -m`
os=`uname -s`
release=`uname -r`
echo "" > kernsh/include/info.h
echo "#ifndef __INFO_H__" >> kernsh/include/info.h
echo " #define __INFO_H__" >> kernsh/include/info.h
echo "" >> kernsh/include/info.h
echo "#define ARCH \"$arch\"" >> kernsh/include/info.h
echo "#define OS \"$os\"" >> kernsh/include/info.h
echo "#define RELEASE \"$release\"" >> kernsh/include/info.h
if [ $os = 'Linux' ]; then
echo "" > libkernsh/include/libkernsh-info.h
echo "#ifndef __LIBKERNSH_INFO_H__" >> libkernsh/include/libkernsh-info.h
echo " #define __LIBKERNSH_INFO_H__" >> libkernsh/include/libkernsh-info.h
res=`expr match "$release" '2.4.*'`
if [ $res = 8 ]; then
echo "#define __LINUX_2_4__ 1" >> libkernsh/include/libkernsh-info.h
else
echo "#define __LINUX_2_4__ 0" >> libkernsh/include/libkernsh-info.h
fi
echo "" >> libkernsh/include/libkernsh-info.h
echo "#endif" >> libkernsh/include/libkernsh-info.h
fi
echo "" >> kernsh/include/info.h
echo "#endif" >> kernsh/include/info.h
KERNSH="1"
fi
;;
--enable-ke2dbg*)
kos=`uname -s`
if [ $kos = 'Linux' ]; then
echo " [*] Enable ke2dbg kernel debugger"
echo "USE_KE2DBG = 1" >> $CONFIGFILE
else
echo "Error: ke2dbg currently only works on Linux, do not enable it on this machine"
exit
fi
;;
--prefix*)
shift
PREFIX=$1
;;
--help*)
CHOSENBIT="0"
break;
;;
*)
echo "Invalid configure '$1' option. Try --help."
echo
rm -f $CONFIGFILE Makefile
exit 1
esac;
shift
done
if [ ! "$LIBASM_ENABLE_CHOOSEN" = 1 ];
then
echo " [*] Libasm IA32 engine"
echo " [*] Libasm SPARC engine"
echo " [*] Libasm MIPS engine"
echo " [*] Libasm ARM engine"
echo "LIBASM_ENABLE_IA32 = 1" >> $CONFIGFILE
echo "LIBASM_ENABLE_SPARC = 1" >> $CONFIGFILE
echo "LIBASM_ENABLE_MIPS = 1" >> $CONFIGFILE
echo "LIBASM_ENABLE_ARM = 1" >> $CONFIGFILE
fi
if [ "$LIBASM_PACKED_HANDLERS" != "0" ] ; then
echo " [*] Libasm Packed handlers"
echo "LIBASM_PACKED_HANDLERS = 1" >> $CONFIGFILE
else
echo " [*] Libasm Unpacked handlers"
echo "LIBASM_PACKED_HANDLERS = 0" >> $CONFIGFILE
fi
#
# test for make/gmake support
#
if [ -z "$(which gmake)" ] ; then
echo "MAKE=make" >> $CONFIGFILE
else
echo "MAKE=gmake" >> $CONFIGFILE
fi
if [ $CHOSENBIT = "0" ]; then
printHelp
fi
if [ $READLN = "1" -a $ERESI_NET = "1" ]; then
echo
echo "Error: Readline and Distributed ELFsh are incompatible."
echo
rm -f $CONFIGFILE $VARSFILE
exit
fi
# Now do the OS dependant configuration
case `uname` in
SunOS*)
if [ "$STATIC" = "0" ]; then
echo " [*] Enabling dynamic linking."
echo "DLOPT = -ldl" >> $CONFIGFILE
fi
EXTRAOPT="$EXTRAOPT -lnsl -lsocket -lresolv"
echo "EXTRAOPT = " $EXTRAOPT >> $CONFIGFILE
echo "RANLIB = ranlib" >> $CONFIGFILE
;;
Linux*)
echo "RANLIB = ranlib" >> $CONFIGFILE
echo "DLOPT = -ldl" >> $CONFIGFILE
if [ "$STATIC" = "0" ]; then
echo " [*] Enabling dynamic linking."
echo "DYNOPT = -rdynamic" >> $CONFIGFILE
fi
if [ "$ERESI_NET" = "1" ]; then
EXTRAOPT="$EXTRAOPT -lutil"
echo "EXTRAOPT = " $EXTRAOPT >> $CONFIGFILE
fi
if [ "$PREFIX" = "" ]; then
PREFIX="/usr"
fi
;;
FreeBSD*)
echo " [*] OS Version: $OSVER"
echo "RANLIB = ranlib" >> $CONFIGFILE
SHELL="/bin/sh"
if [ "$PREFIX" = "" ]; then
PREFIX="/usr/local/"
fi
if [ "$STATIC" = "0" ]; then
echo " [*] Enabling dynamic linking."
echo "DYNOPT = -rdynamic" >> $CONFIGFILE
fi
if [ "$ERESI_NET" = "1" ]; then
EXTRAOPT="$EXTRAOPT -lutil"
echo "EXTRAOPT = " $EXTRAOPT >> $CONFIGFILE
fi
if [ "$OSVER" = "4" ]; then
LPTHREAD="-lc_r"
fi
MODPATHSET="0";
FREEBSD="1";
;;
NetBSD*)
echo " [*] OS Version: $OSVER"
echo "RANLIB = ranlib" >> $CONFIGFILE
SHELL="/bin/sh"
if [ "$STATIC" = "0" ]; then
echo " [*] Enabling dynamic linking."
echo "DYNOPT = -rdynamic" >> $CONFIGFILE
fi
;;
*BSD*)
echo "RANLIB = ranlib" >> $CONFIGFILE
;;
HP-UX*)
echo "#define HPUX 1" >> $LIBVARSFILE
echo "RANLIB = ranlib" >> $CONFIGFILE
;;
IRIX*)
echo "#define ERESI_EXTSHELL \"/usr/freeware/bin/bash\"" >> $VARSFILE
if [ "$SHELLSET" != "1" ]; then
echo "#define ERESI_EXTSHELL \"/usr/freeware/bin/bash\"" >> $VARSFILE
SHELLSET="1"
fi
SHELL="/usr/freeware/bin/bash"
echo "#define IRIX 1" >> $LIBVARSFILE
echo "RANLIB = /usr/bin/ar -rs" >> $CONFIGFILE
echo "CC = gcc" >> $CONFIGFILE
;;
Haiku*|BeOS*)
SHELL="/bin/sh"
echo "#define BEOS 1" >> $LIBVARSFILE
echo "RANLIB = ranlib" >> $CONFIGFILE
LPTHREAD=""
BEOS=1;
;;
*)
if [ "$STATIC" = "0" ]; then
echo " [*] Enabling dynamic linking."
echo "DYNOPT = -rdynamic" >> $CONFIGFILE
fi
if [ "$ERESI_NET" = "1" ]; then
EXTRAOPT="$EXTRAOPT -lutil"
echo "EXTRAOPT = " $EXTRAOPT >> $CONFIGFILE
fi
;;
esac
# Set default variables in case it was not precised
if [ "$MODPATHSET" != "1" ]; then
echo "#define ERESI_MODPATH \"$BASEPATH/share/eresi/\"" >> $VARSFILE
fi
if [ "$LIBPATHSET" != "1" ]; then
echo "#define ERESI_LIBPATH \"/lib;/usr/lib;/usr/local/lib:$BASEPATH/lib/\"" >> $VARSFILE
fi
if [ "$TESTING" != "1" ]; then
echo "#define E2DBG_PATH \"$BASEPATH/lib/\"" >> $VARSFILE
fi
if [ "$SLOGSET" != "1" ]; then
echo "#define ERESI_SLOG 0" >> $VARSFILE
fi
if [ "$SHELLSET" != "1" ]; then
echo "#define ERESI_EXTSHELL \"/bin/bash\"" >> $VARSFILE
fi
if [ "$EDITORSET" != "1" ]; then
echo "#define ERESI_EDITOR \"emacs\"" >> $VARSFILE
fi
if [ "$BUILDOP" != "1" ]; then
echo "BUILDOP = -DM32" >> $CONFIGFILE
fi
echo " [*] Prefix: " $PREFIX
echo " [*] Enabling libasm support"
echo "LDASMOPT = -lasm" >> $CONFIGFILE
echo "LPTHREAD= $LPTHREAD" >> $CONFIGFILE
echo "BITS = " $BITS >> $CONFIGFILE
echo "SHELL= " $SHELL >> $CONFIGFILE
if [ "$KERNSH" = "1" ]; then
echo "KERNSH = -DKERNSH" >> $CONFIGFILE
echo "KERNSHLIB32 = -L../libkernsh/ -lkernsh32" >> $CONFIGFILE
echo "KERNSHLIB64 = -L../libkernsh/ -lkernsh64" >> $CONFIGFILE
echo "KERNSHINC = -I../libkernsh/include" >> $CONFIGFILE
echo "KERNSHINCINC = -I../../libkernsh/include" >> $CONFIGFILE
fi
echo "##" > Makefile
echo "## Makefile " >> Makefile
echo "## " >> Makefile
echo "## Started on Fri Dec 7 06:54:35 2001 jfv" >> Makefile
echo "## Automatically generated from the configure script" >> Makefile
echo "## " >> Makefile
echo "" >> Makefile
echo "include ./$CONFIGFILE " >> Makefile
echo "" >> Makefile
echo "CC = gcc " >> Makefile
echo "RM = rm -f " >> Makefile
if which etags 2>/dev/null; then
echo "ETAGS = etags " >> Makefile
elif which etags.emacs 2>/dev/null; then
echo "ETAGS = etags.emacs " >> Makefile
fi
echo "CTAGS = ctags " >> Makefile
echo "DESTDIR = $PREFIX" >> Makefile
echo "BUILD_TARGET = $BUILD_TARGET" >> Makefile
echo "MOD_TARGET = $MOD_TARGET" >> Makefile
if [ "$FREEBSD" = "1" ]; then
echo "BASEPATH = \$(DESTDIR)/" >> Makefile
echo "MANPATH = \$(BASEPATH)/man" >> Makefile
elif [ "$BEOS" = "1" ]; then
echo "BASEPATH = \$(DESTDIR)/" >> Makefile
echo "MANPATH = \$(BASEPATH)/man" >> Makefile
else
echo "BASEPATH = \$(DESTDIR)/" >> Makefile
echo "MANPATH = \$(BASEPATH)/share/man" >> Makefile
fi
echo "MODPATH = \$(BASEPATH)/share/elfsh/" >> Makefile
echo "BINPATH = \$(BASEPATH)/bin/" >> Makefile
echo "LIBPATH = \$(BASEPATH)/lib/" >> Makefile
echo "#define LIBPATH \"$PREFIX/lib/\"" >> $VARSFILE
echo "INCPATH = \$(BASEPATH)/include/" >> Makefile
echo "RM = rm -f " >> Makefile
echo "" >> Makefile
echo "all : world modules testsuite tags" >> Makefile
cat >> Makefile <<EOF
sed -ie "s%TESTING_ROOT=.*%TESTING_ROOT=`pwd`/%" eresi-config
ifdef NAME
include build/defs/dep-rules.def
component: dep-\$(NAME)
else
component:
@echo Please indicate which component by specifying a NAME option.
@echo gmake component NAME=component-name
@echo Component names are mostly subdirectories
endif
EOF
echo "world : " >> Makefile
echo " @echo 'Building liballocproxy ..' " >> Makefile
echo " @cd liballocproxy && \$(MAKE) " >> Makefile
echo " @echo 'Liballoc-proxy has been built successfully.' " >> Makefile
echo " @echo 'Building libaspect..' " >> Makefile
echo " @cd libaspect && \$(MAKE) \$(BUILD_TARGET)" >> Makefile
echo " @echo 'Libaspect has been built successfully.' " >> Makefile
echo " @echo 'Building libasm...' " >> Makefile
echo " @cd libasm && sh configure " >> Makefile
echo " @cd libasm && \$(MAKE) \$(BUILD_TARGET)" >> Makefile
echo " @echo 'Libasm has been built successfully.' " >> Makefile
if [ "$KERNSH" = "1" ]; then
echo " @echo 'Building libkernsh...' " >> Makefile
echo " @cd libkernsh && \$(MAKE) \$(BUILD_TARGET) " >> Makefile
echo " @echo 'Libkernsh has been built successfully.' " >> Makefile
fi
echo " @echo 'Building libelfsh...' " >> Makefile
echo " @cd libelfsh && \$(MAKE) \$(BUILD_TARGET)" >> Makefile
echo " @echo 'Libelfsh has been built successfully.' " >> Makefile
echo " @echo 'Building libetrace...' " >> Makefile
echo " @cd libetrace && \$(MAKE) \$(BUILD_TARGET)" >> Makefile
echo " @echo 'Libetrace has been built successfully.' " >> Makefile
echo " @echo 'Building libedfmt...' " >> Makefile
echo " @cd libedfmt && \$(MAKE) \$(BUILD_TARGET) " >> Makefile
echo " @echo 'Libedfmt has been built successfully.' " >> Makefile
if [ "$ERESI_NET" = "1" ]; then
echo " @echo 'Building libdump...' " >> Makefile
echo " @cd libdump && \$(MAKE) \$(BUILD_TARGET)" >> Makefile
echo " @echo 'Libdump has been built successfully.' " >> Makefile
fi
echo " @echo 'Building libui...' " >> Makefile
echo " @cd libui && \$(MAKE) \$(BUILD_TARGET) " >> Makefile
echo " @echo 'Libui has been built successfully.' " >> Makefile
echo " @echo 'Building libmjollnir...' " >> Makefile
echo " @cd libmjollnir && \$(MAKE) \$(BUILD_TARGET) " >> Makefile
echo " @echo 'Libmjollnir has been built successfully.'" >> Makefile
echo " @echo 'Building librevm...' " >> Makefile
echo " @cd librevm && \$(MAKE) \$(BUILD_TARGET) " >> Makefile
echo " @echo 'Librevm has been built successfully.'" >> Makefile
# If we compiled librevm with readline, we need to compile it a second
# time without it, to be linked with libe2dbg in the embedded debugger
if [ "$READLN" = "1" ]; then
echo " test -f config.h && cp config.h config.back" >> Makefile
echo " cat $CONFIGFILE | grep -v READLN > t && mv t $CONFIGFILE" >> Makefile
echo " @echo 'Rebuilding librevm/io/ without readline'">> Makefile
echo " @cd librevm/io/ && \$(MAKE) clean " >> Makefile
echo " @cd librevm/io/ && \$(MAKE) \$(BUILD_TARGET) " >> Makefile
echo " cp config.back config.h" >> Makefile
echo " @echo 'Librevm has been rebuilt successfully.'" >> Makefile
fi
echo " @echo 'Building libstderesi...' " >> Makefile
echo " @cd libstderesi && \$(MAKE) \$(BUILD_TARGET) " >> Makefile
echo " @echo 'Libstderesi has been built successfully.'" >> Makefile
echo " @echo 'Building libe2dbg...' " >> Makefile
echo " @cd libe2dbg && \$(MAKE) \$(BUILD_TARGET) " >> Makefile
echo " @echo 'Libe2dbg has been built successfully.'" >> Makefile
echo " @echo 'Building ELFsh ET_EXEC' " >> Makefile
echo " @cd elfsh && \$(MAKE) \$(BUILD_TARGET) " >> Makefile
echo " @echo 'ELFsh ET_EXEC has been built successfully.' " >> Makefile
echo "" >> Makefile
echo " @echo 'Building E2dbg' " >> Makefile
echo " @cd e2dbg && \$(MAKE) \$(BUILD_TARGET) " >> Makefile
echo " @echo 'E2dbg has been built successfully.' " >> Makefile
echo "" >> Makefile
echo " @echo 'Building Etrace' " >> Makefile
echo " @cd etrace && \$(MAKE) \$(BUILD_TARGET) " >> Makefile
echo " @echo 'ETrace has been built successfully.' " >> Makefile
echo "" >> Makefile
echo " @echo 'Building Evarista' " >> Makefile
echo " @cd evarista && \$(MAKE) \$(BUILD_TARGET) " >> Makefile
echo " @echo 'Evarista has been built successfully.' " >> Makefile
echo "" >> Makefile
echo " @echo 'Building libgdbwrap' " >> Makefile
echo " @cd libgdbwrap && \$(MAKE) \$(BUILD_TARGET) " >> Makefile
echo " @echo 'libgdbwrap has been built successfully.' " >> Makefile
echo "" >> Makefile
echo " @echo 'Building Kedbg' " >> Makefile
echo " @cd kedbg && \$(MAKE) \$(BUILD_TARGET) " >> Makefile
echo " @echo 'Kedbg has been built successfully.' " >> Makefile
echo "" >> Makefile
if [ "$KERNSH" = "1" ]; then
echo " @echo 'Building kernsh...' " >> Makefile
echo " @cd kernsh && \$(MAKE) \$(BUILD_TARGET) " >> Makefile
echo " @echo 'Kernsh has been built successfully.' " >> Makefile
fi
if [ ! -e ~/.eresirc ]; then
echo " @cp doc/eresirc.example ~/.eresirc " >> Makefile
fi
if [ ! -e ~/.elfshrc ]; then
echo " @ln -sf ~/.eresirc ~/.elfshrc" >> Makefile
fi
if [ ! -e ~/.e2dbgrc ]; then
echo " @ln -sf ~/.eresirc ~/.e2dbgrc" >> Makefile
fi
if [ ! -e ~/.etracerc ]; then
echo " @ln -sf ~/.eresirc ~/.etracerc" >> Makefile
fi
if [ ! -e ~/.kernshrc ]; then
echo " @ln -sf ~/.eresirc ~/.kernshrc" >> Makefile
fi
echo ".PHONY: modules " >> Makefile
echo "modules: " >> Makefile
echo " @echo 'Building ERESI modules...' " >> Makefile
echo " @cd modules && \$(MAKE) -s \$(BUILD_TARGET)" >> Makefile
echo " @echo 'ERESI modules built successfully.' " >> Makefile
if [ "$TESTING" = "1" ]; then
echo "" >> Makefile
echo ".PHONY: testsuite " >> Makefile
echo "testsuite:" >> Makefile
echo " \$(shell source env.sh)" >> Makefile
echo " @echo 'Building ERESI testsuite...' " >> Makefile
echo " cd testsuite && \$(MAKE) -s \$(BUILD_TARGET)" >> Makefile
echo " @echo 'ERESI testsuite built successfully.' " >> Makefile
fi
if [ "$TESTING" = "1" ]; then
echo " @echo" >> Makefile
echo " @echo Now source env.sh" >> Makefile
echo " @echo" >> Makefile
fi
# Create links for 64bits mode
echo "install64 :" >> Makefile
echo " @ln -sf \$(BINPATH)elfsh64 \$(BINPATH)elfsh" >> Makefile
echo " @ln -sf \$(BINPATH)e2dbg64 \$(BINPATH)e2dbg" >> Makefile
echo " @ln -sf \$(BINPATH)etrace64 \$(BINPATH)etrace" >> Makefile
echo " @ln -sf \$(BINPATH)evarista64 \$(BINPATH)evarista" >> Makefile
if [ "$KERNSH" = "1" ]; then
echo " @ln -sf \$(BINPATH)kernsh64 \$(BINPATH)kernsh" >> Makefile
fi
echo " @ln -sf \$(BINPATH)kedbg64 \$(BINPATH)kedbg" >> Makefile
echo " @ln -sf \$(BINPATH)eresi-config64 \$(BINPATH)eresi-config" >> Makefile
echo " @ln -sf \$(LIBPATH)libaspect64.a \$(LIBPATH)libaspect.a" >> Makefile
echo " @ln -sf \$(LIBPATH)libelfsh64.a \$(LIBPATH)libelfsh.a" >> Makefile
echo " @ln -sf \$(LIBPATH)libetrace64.a \$(LIBPATH)libetrace.a " >> Makefile
echo " @ln -sf \$(LIBPATH)libe2dbg64.a \$(LIBPATH)libe2dbg.a" >> Makefile
echo " @ln -sf \$(LIBPATH)libmjollnir64.a \$(LIBPATH)libmjollnir.a" >> Makefile
echo " @ln -sf \$(LIBPATH)librevm64.a \$(LIBPATH)librevm.a" >> Makefile
echo " @ln -sf \$(LIBPATH)libstderesi64.a \$(LIBPATH)libstderesi.a" >> Makefile
echo " @ln -sf \$(LIBPATH)libedfmt64.a \$(LIBPATH)libedfmt.a" >> Makefile
echo " @ln -sf \$(LIBPATH)libui64.a \$(LIBPATH)libui.a" >> Makefile
if [ "$KERNSH" = "1" ]; then
echo " @ln -sf \$(LIBPATH)libkernsh64.a \$(LIBPATH)libkernsh.a" >> Makefile
fi
echo " @ln -sf \$(LIBPATH)libgdbwrap64.a \$(LIBPATH)libgdbwrap.a" >> Makefile
echo " @ln -sf \$(LIBPATH)libaspect64.so \$(LIBPATH)libaspect.so" >> Makefile
echo " @ln -sf \$(LIBPATH)libelfsh64.so \$(LIBPATH)libelfsh.so" >> Makefile
echo " @ln -sf \$(LIBPATH)libetrace64.so \$(LIBPATH)libetrace.so" >> Makefile
echo " @ln -sf \$(LIBPATH)libe2dbg64.so \$(LIBPATH)libe2dbg.so" >> Makefile
echo " @ln -sf \$(LIBPATH)libmjollnir64.so \$(LIBPATH)libmjollnir.so" >> Makefile
echo " @ln -sf \$(LIBPATH)librevm64.so \$(LIBPATH)librevm.so" >> Makefile
echo " @ln -sf \$(LIBPATH)libstderesi64.so \$(LIBPATH)libstderesi.so" >> Makefile
echo " @ln -sf \$(LIBPATH)libedfmt64.so \$(LIBPATH)libedfmt.so" >> Makefile
echo " @ln -sf \$(LIBPATH)libui64.so \$(LIBPATH)libui.so" >> Makefile
if [ "$KERNSH" = "1" ]; then
echo " @ln -sf \$(LIBPATH)libkernsh64.so \$(LIBPATH)libkernsh.so" >> Makefile
fi
echo " @ln -sf \$(LIBPATH)libgdbwrap64.so \$(LIBPATH)libgdbwrap.so" >> Makefile
echo "install : prepareDir #mod_install " >> Makefile
echo " @cp elfsh/elfsh?? \$(BINPATH)/ " >> Makefile
echo " @cp e2dbg/e2dbg?? \$(BINPATH)/ " >> Makefile
echo " @cp etrace/etrace?? \$(BINPATH)/ " >> Makefile
echo " @cp evarista/evarista?? \$(BINPATH)/ " >> Makefile
if [ "$KERNSH" = "1" ]; then
echo " @cp kernsh/kernsh?? \$(BINPATH)/ " >> Makefile
fi
echo " @cp kedbg/kedbg?? \$(BINPATH)/ " >> Makefile
echo " @cp eresi-config?? \$(BINPATH)/ " >> Makefile
if [ "$KERNSH" = "1" ]; then
echo " @cp libkernsh/libkernsh*.a libkernsh/libkernsh*.so \$(LIBPATH) " >> Makefile
fi
echo " @cp libgdbwrap/libgdbwrap*.a libgdbwrap/libgdbwrap*.so \$(LIBPATH) " >> Makefile
echo " @cp libaspect/libaspect*.a libaspect/libaspect*.so \$(LIBPATH) " >> Makefile
echo " @cp liballocproxy/liballocproxy.a \$(LIBPATH) " >> Makefile
echo " @cp libelfsh/libelfsh*.a libelfsh/libelfsh*.so \$(LIBPATH) " >> Makefile
echo " @cp libetrace/libetrace*.a libetrace/libetrace*.so \$(LIBPATH) " >> Makefile
echo " @cp libe2dbg/libe2dbg*.a libe2dbg/libe2dbg*.so \$(LIBPATH) " >> Makefile
echo " @cp libasm/libasm*.a libasm/libasm*.so \$(LIBPATH) " >> Makefile
echo " @cp libmjollnir/libmjollnir*.a \$(LIBPATH) " >> Makefile
echo " @cp libmjollnir/libmjollnir*.so \$(LIBPATH) " >> Makefile
echo " @cp librevm/librevm*.a librevm/librevm*.so \$(LIBPATH)" >> Makefile
echo " @cp libstderesi/libstderesi*.a libstderesi/libstderesi*.so \$(LIBPATH)" >> Makefile
echo " @cp libedfmt/libedfmt*.a libedfmt/libedfmt*.so \$(LIBPATH) " >> Makefile
echo " @cp libui/libui*.a libui/libui*.so \$(LIBPATH) " >> Makefile
if [ "$KERNSH" = "1" ]; then
echo " @cp libkernsh/libkernsh*.a libkernsh/libkernsh*.so \$(LIBPATH) " >> Makefile
echo " @cp kernsh/kernsh?? \$(BINPATH)/ " >> Makefile
fi
# Create links
echo " @ln -sf \$(BINPATH)elfsh32 \$(BINPATH)elfsh" >> Makefile
echo " @ln -sf \$(BINPATH)e2dbg32 \$(BINPATH)e2dbg" >> Makefile
echo " @ln -sf \$(BINPATH)etrace32 \$(BINPATH)etrace" >> Makefile
echo " @ln -sf \$(BINPATH)evarista32 \$(BINPATH)evarista" >> Makefile
if [ "$KERNSH" = "1" ]; then
echo " @ln -sf \$(BINPATH)kernsh32 \$(BINPATH)kernsh" >> Makefile
fi
echo " @ln -sf \$(BINPATH)kedbg32 \$(BINPATH)kedbg" >> Makefile
echo " @ln -sf \$(BINPATH)eresi-config32 \$(BINPATH)eresi-config" >> Makefile
echo " @ln -sf \$(LIBPATH)libaspect32.a \$(LIBPATH)libaspect.a" >> Makefile
echo " @ln -sf \$(LIBPATH)libelfsh32.a \$(LIBPATH)libelfsh.a" >> Makefile
echo " @ln -sf \$(LIBPATH)libetrace32.a \$(LIBPATH)libetrace.a" >> Makefile
echo " @ln -sf \$(LIBPATH)libe2dbg32.a \$(LIBPATH)libe2dbg.a" >> Makefile
echo " @ln -sf \$(LIBPATH)libmjollnir32.a \$(LIBPATH)libmjollnir.a" >> Makefile
echo " @ln -sf \$(LIBPATH)librevm32.a \$(LIBPATH)librevm.a" >> Makefile
echo " @ln -sf \$(LIBPATH)libstderesi32.a \$(LIBPATH)libstderesi.a" >> Makefile
echo " @ln -sf \$(LIBPATH)libedfmt32.a \$(LIBPATH)libedfmt.a" >> Makefile
echo " @ln -sf \$(LIBPATH)libui32.a \$(LIBPATH)libui.a" >> Makefile
if [ "$KERNSH" = "1" ]; then
echo " @ln -sf \$(LIBPATH)libkernsh32.a \$(LIBPATH)libkernsh.a" >> Makefile
fi
echo " @ln -sf \$(LIBPATH)libgdbwrap32.a \$(LIBPATH)libgdbwrap.a" >> Makefile
echo " @ln -sf \$(LIBPATH)libaspect32.so \$(LIBPATH)libaspect.so" >> Makefile
echo " @ln -sf \$(LIBPATH)libelfsh32.so \$(LIBPATH)libelfsh.so" >> Makefile
echo " @ln -sf \$(LIBPATH)libetrace32.so \$(LIBPATH)libetrace.so" >> Makefile
echo " @ln -sf \$(LIBPATH)libe2dbg32.so \$(LIBPATH)libe2dbg.so" >> Makefile
echo " @ln -sf \$(LIBPATH)libmjollnir32.so \$(LIBPATH)libmjollnir.so" >> Makefile
echo " @ln -sf \$(LIBPATH)librevm32.so \$(LIBPATH)librevm.so" >> Makefile
echo " @ln -sf \$(LIBPATH)libstderesi32.so \$(LIBPATH)libstderesi.so" >> Makefile
echo " @ln -sf \$(LIBPATH)libedfmt32.so \$(LIBPATH)libedfmt.so" >> Makefile
echo " @ln -sf \$(LIBPATH)libui32.so \$(LIBPATH)libui.so" >> Makefile
if [ "$KERNSH" = "1" ]; then
echo " @ln -sf \$(LIBPATH)libkernsh32.so \$(LIBPATH)libkernsh.so" >> Makefile
fi
echo " @ln -sf \$(LIBPATH)libgdbwrap32.so \$(LIBPATH)libgdbwrap.so" >> Makefile
# Install headers
echo " @cp -R libelfsh/include/* \$(INCPATH) " >> Makefile
echo " @cp -R libetrace/include/* \$(INCPATH) " >> Makefile
echo " @cp libasm/include/*.h \$(INCPATH)" >> Makefile
echo " @cp libaspect/include/*.h \$(INCPATH)" >> Makefile
echo " @cp librevm/include/*.h \$(INCPATH)" >> Makefile
echo " @cp libstderesi/include/*.h \$(INCPATH)" >> Makefile
echo " @cp libedfmt/include/*.h \$(INCPATH) " >> Makefile
echo " @cp libui/include/libui.h \$(INCPATH) " >> Makefile
echo " @cp libmjollnir/include/libmjollnir*.h \$(INCPATH) " >> Makefile
if [ "$KERNSH" = "1" ]; then
echo " @cp libkernsh/include/libkernsh.h \$(INCPATH) " >> Makefile
fi
# Install mans
echo " @cp doc/eresi.1 \$(MANPATH)/man1/ " >> Makefile
echo " @chmod 644 \$(MANPATH)/man1/eresi.1 " >> Makefile
# Put rights
echo " @chmod 755 \$(BINPATH)elfsh?? " >> Makefile
echo " @chmod 755 \$(BINPATH)e2dbg??" >> Makefile
echo " @chmod 755 \$(BINPATH)etrace?? " >> Makefile
echo " @chmod 755 \$(BINPATH)evarista?? " >> Makefile
if [ "$KERNSH" = "1" ]; then
echo " @chmod 755 \$(BINPATH)kernsh?? " >> Makefile
echo " @chmod 644 \$(LIBPATH)libkernsh*.so " >> Makefile
echo " @chmod 644 \$(INCPATH)libkernsh*.h " >> Makefile
fi
echo " @chmod 644 \$(LIBPATH)libelfsh*.so " >> Makefile
echo " @chmod 644 \$(LIBPATH)libetrace*.so " >> Makefile
echo " @chmod 644 \$(LIBPATH)libe2dbg*.so " >> Makefile
echo " @chmod 644 \$(LIBPATH)libaspect*.so " >> Makefile
echo " @chmod 644 \$(LIBPATH)libaspect*.a " >> Makefile
echo " @chmod 644 \$(LIBPATH)librevm*.so " >> Makefile
echo " @chmod 644 \$(LIBPATH)librevm*.a " >> Makefile
echo " @chmod 644 \$(LIBPATH)libstderesi*.so " >> Makefile
echo " @chmod 644 \$(LIBPATH)libstderesi*.a " >> Makefile
echo " @chmod 644 \$(LIBPATH)libedfmt*.so " >> Makefile
echo " @chmod 644 \$(LIBPATH)libedfmt*.a " >> Makefile
echo " @chmod 644 \$(LIBPATH)libui*.so " >> Makefile
echo " @chmod 644 \$(LIBPATH)libui*.a " >> Makefile
echo " @chmod 644 \$(INCPATH)libui.h " >> Makefile
echo " @chmod 644 \$(INCPATH)libelfsh*.h " >> Makefile
echo " @chmod 644 \$(LIBPATH)libelfsh*.a " >> Makefile
echo " @chmod 644 \$(LIBPATH)libasm*.a " >> Makefile
echo " @chmod 644 \$(INCPATH)libedfmt*.h " >> Makefile
echo " @chmod 644 \$(INCPATH)libasm*.h " >> Makefile
echo " @chmod 644 \$(INCPATH)libmjollnir.h " >> Makefile
echo " @chmod 644 \$(INCPATH)libaspect*.h " >> Makefile
echo " @chmod 644 \$(INCPATH)librevm*.h " >> Makefile
echo " @chmod 644 \$(INCPATH)libstderesi*.h " >> Makefile
echo "" >> Makefile
echo "prepareDir: " >> Makefile
echo " @mkdir -p \$(BINPATH) || true" >> Makefile
echo " @mkdir -p \$(LIBPATH) || true" >> Makefile
echo " @mkdir -p \$(INCPATH) || true" >> Makefile
echo " @mkdir -p \$(MANPATH)/man1/ || true" >> Makefile
echo " @mkdir -p \$(MODPATH) || true" >> Makefile
if [ "$FREEBSD" = "1" ]; then
echo " @ldconfig -R" >> Makefile
fi
echo " @echo 'ELFsh, E2dbg, Etrace, Evarista, Libelfsh, Libe2dbg, \\" >> Makefile
echo "Libmjollnir, Libasm, Libedfmt, Libui, Librevm, Libstderesi \\" >> Makefile
echo "and Libaspect installed successfully .'" >> Makefile
echo " @echo Default installation is 32bits : make install64 if requested" >> Makefile
echo "mod_install: " >> Makefile
echo " @mkdir \$(MODPATH) 2>/dev/null || true " >> Makefile
echo " @cp modules/*.so \$(MODPATH) " >> Makefile
echo " @chmod -R 755 \$(MODPATH) " >> Makefile
echo "" >> Makefile
echo "uninstall: " >> Makefile
echo " rm -f \$(BINPATH)/elfsh*" >> Makefile
echo " rm -f \$(BINPATH)/e2dbg*" >> Makefile
echo " rm -f \$(BINPATH)/etrace*" >> Makefile
echo " rm -f \$(BINPATH)/evarista*" >> Makefile
echo " rm -f \$(BINPATH)/eresi-config*" >> Makefile
echo " rm -f \$(BINPATH)/kedbg*" >> Makefile
echo " rm -f \$(LIBPATH)/libelfsh*" >> Makefile
echo " rm -f \$(LIBPATH)/libetrace*" >> Makefile
echo " rm -f \$(LIBPATH)/libe2dbg*" >> Makefile
echo " rm -f \$(LIBPATH)/libui*" >> Makefile
echo " rm -f \$(LIBPATH)/liballocproxy*" >> Makefile
echo " rm -f \$(LIBPATH)/libmjollnir*" >> Makefile
echo " rm -f \$(LIBPATH)/libaspect*" >> Makefile
echo " rm -f \$(LIBPATH)/librevm*" >> Makefile
echo " rm -f \$(LIBPATH)/libstderesi*" >> Makefile
echo " rm -f \$(LIBPATH)/libedfmt*" >> Makefile
echo " rm -f \$(LIBPATH)/libasm*" >> Makefile
echo " rm -f \$(LIBPATH)/libgdbwrap*" >> Makefile
echo " rm -f \$(LIBPATH)/libmalloc-e2dbg*" >> Makefile
echo " rm -fr \$(MODPATH) " >> Makefile
echo " rm -f \$(MANPATH)/man1/elfsh.1 " >> Makefile
echo " rm -f \$(INCPATH)/libasm*.h " >> Makefile
echo " rm -f \$(INCPATH)/libmjollnir*.h " >> Makefile
echo " rm -f \$(INCPATH)/libui.h " >> Makefile
echo " rm -f \$(INCPATH)/aproxy.h " >> Makefile