diff --git a/project.conf b/project.conf index c6cdf54..6565edd 100644 --- a/project.conf +++ b/project.conf @@ -6,6 +6,13 @@ subdirs=data,doc,include,src,tools,tests targets=tests dist=Makefile,COPYING,config.ent,config.h,config.sh +#modes +[mode::debug] +title=Debug + +[mode::release] +title=Release + #targets [tests] type=command diff --git a/src/arch/project.conf b/src/arch/project.conf index cdd3d46..01f1bc4 100644 --- a/src/arch/project.conf +++ b/src/arch/project.conf @@ -1,173 +1,182 @@ targets=amd64,arm,armeb,armel,dalvik,eth,i386,i386_real,i486,i586,i686,java,mips,mipseb,mipsel,sparc,sparc64,template,yasep,yasep16,yasep32 -cppflags_force=-I ../../include +cppflags_force=-I../../include cflags_force=`pkg-config --cflags libSystem` -fPIC cflags=-W -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector ldflags_force=`pkg-config --libs libSystem` dist=Makefile,amd64.ins,amd64.pre,amd64.reg,arm.h,arm.ins,arm.reg,common.ins,dalvik.ins,dalvik.reg,eth.ins,i386.def,i386.h,i386.ins,i386.pre,i386.reg,i486.ins,i586.ins,i686.ins,i686.reg,mips.h,mips.ins,mips.reg,null.ins,null.pre,null.reg,sparc.h,sparc.ins,sparc.reg,yasep.h,yasep.ins,yasep.reg +#modes +[mode::debug] + +[mode::release] +cppflags_force=-I../../include -DNDEBUG +cflags=-W -Wall -O2 -D_FORTIFY_SOURCE=2 -fstack-protector + +#targets [amd64] type=plugin sources=amd64.c install=$(LIBDIR)/Asm/arch -[amd64.c] -depends=amd64.ins,amd64.pre,amd64.reg,common.ins,i386.h,i386.ins,i386.pre,i386.reg,i486.ins,i686.ins,i686.reg,null.ins,null.pre - [arm] type=plugin sources=arm.c install=$(LIBDIR)/Asm/arch -[arm.c] -depends=arm.h,arm.ins,arm.reg,common.ins,null.ins - [armeb] type=plugin sources=armeb.c install=$(LIBDIR)/Asm/arch -[armeb.c] -depends=$(OBJDIR)arm.o - [armel] type=plugin sources=armel.c install=$(LIBDIR)/Asm/arch -[armel.c] -depends=$(OBJDIR)arm.o - [dalvik] type=plugin sources=dalvik.c install=$(LIBDIR)/Asm/arch -[dalvik.c] -depends=common.ins,dalvik.ins,dalvik.reg,null.ins - [eth] type=plugin sources=eth.c install=$(LIBDIR)/Asm/arch -[eth.c] -depends=common.ins,eth.ins,null.ins - [i386] type=plugin sources=i386.c install=$(LIBDIR)/Asm/arch -[i386.c] -depends=common.ins,i386.def,i386.h,i386.ins,i386.pre,i386.pre,i386.reg,null.ins,null.pre - [i386_real] type=plugin sources=i386_real.c install=$(LIBDIR)/Asm/arch -[i386_real.c] -depends=common.ins,i386.h,i386.ins,i386.pre,i386.reg,null.ins,null.pre - [i486] type=plugin sources=i486.c install=$(LIBDIR)/Asm/arch -[i486.c] -depends=common.ins,i386.def,i386.h,i386.ins,i386.pre,i386.reg,i486.ins,null.ins,null.pre - [i586] type=plugin sources=i586.c install=$(LIBDIR)/Asm/arch -[i586.c] -depends=common.ins,i386.def,i386.h,i386.ins,i386.pre,i386.reg,i486.ins,i586.ins,null.ins,null.pre - [i686] type=plugin sources=i686.c install=$(LIBDIR)/Asm/arch -[i686.c] -depends=common.ins,i386.def,i386.h,i386.ins,i386.pre,i386.reg,i486.ins,i686.ins,i686.reg,null.ins,null.pre - [java] type=plugin sources=java.c install=$(LIBDIR)/Asm/arch -[java.c] -depends=common.ins,null.ins - [mips] type=plugin sources=mips.c install=$(LIBDIR)/Asm/arch -[mips.c] -depends=common.ins,mips.h,mips.ins,mips.reg,null.ins - [mipseb] type=plugin sources=mipseb.c install=$(LIBDIR)/Asm/arch -[mipseb.c] -depends=$(OBJDIR)mips.o - [mipsel] type=plugin sources=mipsel.c install=$(LIBDIR)/Asm/arch -[mipsel.c] -depends=$(OBJDIR)mips.o - [sparc] type=plugin sources=sparc.c install=$(LIBDIR)/Asm/arch -[sparc.c] -depends=common.ins,null.ins,sparc.h,sparc.ins,sparc.reg - [sparc64] type=plugin sources=sparc64.c install=$(LIBDIR)/Asm/arch -[sparc64.c] -depends=common.ins,null.ins,sparc.h,sparc.ins,sparc.reg - [template] type=plugin sources=template.c -[template.c] -depends=common.ins,null.ins,null.pre - [yasep] type=plugin sources=yasep.c install=$(LIBDIR)/Asm/arch -[yasep.c] -depends=common.ins,null.ins,yasep.h,yasep.ins,yasep.reg - [yasep16] type=plugin sources=yasep16.c install=$(LIBDIR)/Asm/arch -[yasep16.c] -depends=common.ins,null.ins,yasep.c,yasep.h,yasep.ins,yasep.reg - [yasep32] type=plugin sources=yasep32.c install=$(LIBDIR)/Asm/arch +#sources +[amd64.c] +depends=amd64.ins,amd64.pre,amd64.reg,common.ins,i386.h,i386.ins,i386.pre,i386.reg,i486.ins,i686.ins,i686.reg,null.ins,null.pre + +[arm.c] +depends=arm.h,arm.ins,arm.reg,common.ins,null.ins + +[armeb.c] +depends=$(OBJDIR)arm.o + +[armel.c] +depends=$(OBJDIR)arm.o + +[dalvik.c] +depends=common.ins,dalvik.ins,dalvik.reg,null.ins + +[eth.c] +depends=common.ins,eth.ins,null.ins + +[i386.c] +depends=common.ins,i386.def,i386.h,i386.ins,i386.pre,i386.pre,i386.reg,null.ins,null.pre + +[i386_real.c] +depends=common.ins,i386.h,i386.ins,i386.pre,i386.reg,null.ins,null.pre + +[i486.c] +depends=common.ins,i386.def,i386.h,i386.ins,i386.pre,i386.reg,i486.ins,null.ins,null.pre + +[i586.c] +depends=common.ins,i386.def,i386.h,i386.ins,i386.pre,i386.reg,i486.ins,i586.ins,null.ins,null.pre + +[i686.c] +depends=common.ins,i386.def,i386.h,i386.ins,i386.pre,i386.reg,i486.ins,i686.ins,i686.reg,null.ins,null.pre + +[java.c] +depends=common.ins,null.ins + +[mips.c] +depends=common.ins,mips.h,mips.ins,mips.reg,null.ins + +[mipseb.c] +depends=$(OBJDIR)mips.o + +[mipsel.c] +depends=$(OBJDIR)mips.o + +[sparc.c] +depends=common.ins,null.ins,sparc.h,sparc.ins,sparc.reg + +[sparc64.c] +depends=common.ins,null.ins,sparc.h,sparc.ins,sparc.reg + +[template.c] +depends=common.ins,null.ins,null.pre + +[yasep.c] +depends=common.ins,null.ins,yasep.h,yasep.ins,yasep.reg + +[yasep16.c] +depends=common.ins,null.ins,yasep.c,yasep.h,yasep.ins,yasep.reg + [yasep32.c] depends=common.ins,null.ins,yasep.c,yasep.h,yasep.ins,yasep.reg diff --git a/src/format/project.conf b/src/format/project.conf index 33e7383..7f32b9e 100644 --- a/src/format/project.conf +++ b/src/format/project.conf @@ -1,10 +1,18 @@ targets=dex,elf,flat,java,mbr,pe -cppflags_force=-I ../../include +cppflags_force=-I../../include cflags_force=`pkg-config --cflags libSystem` -fPIC cflags=-W -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector ldflags_force=`pkg-config --libs libSystem` dist=Makefile,elf/common.h,elf/elf.h,elf/elf.c +#modes +[mode::debug] + +[mode::release] +cppflags_force=-I../../include -DNDEBUG +cflags=-W -Wall -O2 -D_FORTIFY_SOURCE=2 -fstack-protector + +#targets [dex] type=plugin sources=dex.c @@ -15,18 +23,6 @@ type=plugin sources=elf.c,elf/common.c,elf/elf32.c,elf/elf64.c install=$(LIBDIR)/Asm/format -[elf.c] -depends=elf/common.h - -[elf/common.c] -depends=elf/common.h - -[elf/elf32.c] -depends=elf/common.h,elf/elf.h,elf/elf.c - -[elf/elf64.c] -depends=elf/common.h,elf/elf.h,elf/elf.c - [flat] type=plugin sources=flat.c @@ -46,3 +42,16 @@ install=$(LIBDIR)/Asm/format type=plugin sources=pe.c install=$(LIBDIR)/Asm/format + +#sources +[elf.c] +depends=elf/common.h + +[elf/common.c] +depends=elf/common.h + +[elf/elf32.c] +depends=elf/common.h,elf/elf.h,elf/elf.c + +[elf/elf64.c] +depends=elf/common.h,elf/elf.h,elf/elf.c diff --git a/src/project.conf b/src/project.conf index 753cdde..1e515c1 100644 --- a/src/project.conf +++ b/src/project.conf @@ -1,6 +1,6 @@ subdirs=arch,format targets=libAsm,asm,deasm -cppflags_force=-I ../include +cppflags_force=-I../include cppflags= cflags_force=`pkg-config --cflags cpp` cflags=-W -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector @@ -8,6 +8,13 @@ ldflags_force=`pkg-config --libs cpp` ldflags=-ldl -Wl,-z,relro -Wl,-z,now dist=Makefile,arch.h,code.h,common.h,format.h,parser.h,token.h,python/project.conf,python/Makefile,python/libAsm.c,python/libAsm.py +#modes +[mode::debug] + +[mode::release] +cppflags_force=-I../include -DNDEBUG +cflags=-W -Wall -O2 -D_FORTIFY_SOURCE=2 -fstack-protector + [libAsm] type=library sources=arch.c,asm.c,code.c,format.c,parser.c,token.c diff --git a/src/python/project.conf b/src/python/project.conf index bf06dff..f24b1df 100644 --- a/src/python/project.conf +++ b/src/python/project.conf @@ -5,6 +5,14 @@ ldflags_force=`pkg-config --libs python-2.7 cpp` -lAsm ldflags=-L$(OBJDIR).. -Wl,-rpath,$(LIBDIR) dist=Makefile,libAsm.py +#modes +[mode::debug] + +[mode::release] +cppflags_force=-DNDEBUG +cflags=-W -Wall -O2 -D_FORTIFY_SOURCE=2 -fstack-protector + +#targets [_libAsm] type=plugin sources=libAsm.c diff --git a/tests/project.conf b/tests/project.conf index 3025993..bfa2cdf 100644 --- a/tests/project.conf +++ b/tests/project.conf @@ -2,38 +2,27 @@ targets=amd64.o,arm.o,armeb.o,armel.o,coverage.log,clint.log,dalvik.o,eth.o,fixm as=$(OBJDIR)../tools/asm-static dist=Makefile,clint.sh,coverage.sh,fixme.sh,pylint.sh,python.sh,tests.sh +#targets [amd64.o] type=object asflags=-a amd64 sources=amd64.asm -[amd64.asm] -depends=$(OBJDIR)../tools/asm-static$(EXEEXT) - [arm.o] type=object asflags=-a arm sources=arm.asm -[arm.asm] -depends=$(OBJDIR)../tools/asm-static$(EXEEXT) - [armeb.o] type=object asflags=-a armeb sources=armeb.asm -[armeb.asm] -depends=arm.asm,$(OBJDIR)../tools/asm-static$(EXEEXT) - [armel.o] type=object asflags=-a armel sources=armel.asm -[armel.asm] -depends=arm.asm,$(OBJDIR)../tools/asm-static$(EXEEXT) - [clint.log] type=script script=./clint.sh @@ -52,17 +41,11 @@ type=object asflags=-a dalvik -f flat sources=dalvik.asm -[dalvik.asm] -depends=$(OBJDIR)../tools/asm-static$(EXEEXT) - [eth.o] type=object asflags=-a eth sources=eth.asm -[eth.asm] -depends=$(OBJDIR)../tools/asm-static$(EXEEXT) - [fixme.log] type=script script=./fixme.sh @@ -74,73 +57,46 @@ type=object asflags=-a i386 sources=i386.asm -[i386.asm] -depends=$(OBJDIR)../tools/asm-static$(EXEEXT) - [i386_real.o] type=object asflags=-a i386_real -f mbr sources=i386_real.asm -[i386_real.asm] -depends=$(OBJDIR)../tools/asm-static$(EXEEXT) - [i486.o] type=object asflags=-a i486 sources=i486.asm -[i486.asm] -depends=$(OBJDIR)../tools/asm-static$(EXEEXT) - [i586.o] type=object asflags=-a i586 sources=i586.asm -[i586.asm] -depends=$(OBJDIR)../tools/asm-static$(EXEEXT) - [i686.o] type=object asflags=-a i686 sources=i686.asm -[i686.asm] -depends=$(OBJDIR)../tools/asm-static$(EXEEXT) - [java.o] type=object asflags=-a java -f flat sources=java.asm -[java.asm] -depends=$(OBJDIR)../tools/asm-static$(EXEEXT) - [mips.o] type=object asflags=-a mips sources=mips.asm -[mips.asm] -depends=$(OBJDIR)../tools/asm-static$(EXEEXT) - [mipseb.o] type=object asflags=-a mipseb sources=mipseb.asm -[mipseb.asm] -depends=mips.asm,$(OBJDIR)../tools/asm-static$(EXEEXT) - [mipsel.o] type=object asflags=-a mipsel sources=mipsel.asm -[mipsel.asm] -depends=mips.asm,$(OBJDIR)../tools/asm-static$(EXEEXT) - [pylint.log] type=script script=./pylint.sh @@ -152,25 +108,16 @@ type=object asflags=-a sparc sources=sparc.asm -[sparc.asm] -depends=$(OBJDIR)../tools/asm-static$(EXEEXT) - [sparc64.o] type=object asflags=-a sparc64 sources=sparc64.asm -[sparc64.asm] -depends=$(OBJDIR)../tools/asm-static$(EXEEXT) - [template.o] type=object asflags=-a template -f flat sources=template.asm -[template.asm] -depends=$(OBJDIR)../tools/asm-static$(EXEEXT) - [tests.log] type=script script=./tests.sh @@ -183,21 +130,76 @@ type=object asflags=-a yasep -f flat sources=yasep.asm -[yasep.asm] -depends=$(OBJDIR)../tools/asm-static$(EXEEXT) - [yasep16.o] type=object asflags=-a yasep16 -f flat sources=yasep16.asm -[yasep16.asm] -depends=$(OBJDIR)../tools/asm-static$(EXEEXT),yasep.asm - [yasep32.o] type=object asflags=-a yasep32 -f flat sources=yasep32.asm +#sources +[amd64.asm] +depends=$(OBJDIR)../tools/asm-static$(EXEEXT) + +[arm.asm] +depends=$(OBJDIR)../tools/asm-static$(EXEEXT) + +[armeb.asm] +depends=arm.asm,$(OBJDIR)../tools/asm-static$(EXEEXT) + +[armel.asm] +depends=arm.asm,$(OBJDIR)../tools/asm-static$(EXEEXT) + +[dalvik.asm] +depends=$(OBJDIR)../tools/asm-static$(EXEEXT) + +[eth.asm] +depends=$(OBJDIR)../tools/asm-static$(EXEEXT) + +[i386.asm] +depends=$(OBJDIR)../tools/asm-static$(EXEEXT) + +[i386_real.asm] +depends=$(OBJDIR)../tools/asm-static$(EXEEXT) + +[i486.asm] +depends=$(OBJDIR)../tools/asm-static$(EXEEXT) + +[i586.asm] +depends=$(OBJDIR)../tools/asm-static$(EXEEXT) + +[i686.asm] +depends=$(OBJDIR)../tools/asm-static$(EXEEXT) + +[java.asm] +depends=$(OBJDIR)../tools/asm-static$(EXEEXT) + +[mips.asm] +depends=$(OBJDIR)../tools/asm-static$(EXEEXT) + +[mipseb.asm] +depends=mips.asm,$(OBJDIR)../tools/asm-static$(EXEEXT) + +[mipsel.asm] +depends=mips.asm,$(OBJDIR)../tools/asm-static$(EXEEXT) + +[sparc.asm] +depends=$(OBJDIR)../tools/asm-static$(EXEEXT) + +[sparc64.asm] +depends=$(OBJDIR)../tools/asm-static$(EXEEXT) + +[template.asm] +depends=$(OBJDIR)../tools/asm-static$(EXEEXT) + +[yasep.asm] +depends=$(OBJDIR)../tools/asm-static$(EXEEXT) + +[yasep16.asm] +depends=$(OBJDIR)../tools/asm-static$(EXEEXT),yasep.asm + [yasep32.asm] depends=$(OBJDIR)../tools/asm-static$(EXEEXT),yasep.asm diff --git a/tools/project.conf b/tools/project.conf index b4b80e9..c0efdf8 100644 --- a/tools/project.conf +++ b/tools/project.conf @@ -1,16 +1,35 @@ targets=libAsm,asm-static,deasm-static -cppflags_force=-I ../include -DSTANDALONE +cppflags_force=-I../include -DSTANDALONE cflags_force=`pkg-config --cflags cpp` cflags=-W -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector ldflags_force=`pkg-config --libs cpp` ldflags=-Wl,-z,relro -Wl,-z,now dist=Makefile +#modes +[mode::debug] + +[mode::release] +cppflags_force=-I../include -DNDEBUG +cflags=-W -Wall -O2 -D_FORTIFY_SOURCE=2 -fstack-protector + +#targets [libAsm] type=library sources=arch.c,arch/amd64.c,arch/arm.c,arch/armeb.c,arch/armel.c,arch/dalvik.c,arch/eth.c,arch/i386.c,arch/i386_real.c,arch/i486.c,arch/i586.c,arch/i686.c,arch/java.c,arch/mips.c,arch/mipseb.c,arch/mipsel.c,arch/sparc.c,arch/sparc64.c,arch/template.c,arch/yasep.c,arch/yasep16.c,arch/yasep32.c,format.c,format/dex.c,format/elf.c,format/elf/elf32.c,format/elf/elf64.c,format/flat.c,format/java.c,format/mbr.c,format/pe.c,asm.c,code.c,parser.c,token.c cflags=-fPIC +[asm-static] +type=binary +depends=$(OBJDIR)../src/main.o,$(OBJDIR)libAsm.a +ldflags=$(OBJDIR)../src/main.o $(OBJDIR)libAsm.a -pie + +[deasm-static] +type=binary +depends=$(OBJDIR)../src/deasm.o,$(OBJDIR)libAsm.a +ldflags=$(OBJDIR)../src/deasm.o $(OBJDIR)libAsm.a -pie + +#sources [arch.c] depends=../src/arch.c @@ -49,13 +68,3 @@ depends=../src/parser.c [token.c] depends=../src/token.c - -[asm-static] -type=binary -depends=$(OBJDIR)../src/main.o,$(OBJDIR)libAsm.a -ldflags=$(OBJDIR)../src/main.o $(OBJDIR)libAsm.a -pie - -[deasm-static] -type=binary -depends=$(OBJDIR)../src/deasm.o,$(OBJDIR)libAsm.a -ldflags=$(OBJDIR)../src/deasm.o $(OBJDIR)libAsm.a -pie