subdirs=arch,format
targets=libAsm,asm,deasm
cppflags_force=-I../include
cppflags=
cflags_force=`pkg-config --cflags cpp`
cflags=-W -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector
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
cflags=-fPIC
install=$(LIBDIR)

[asm]
type=binary
sources=main.c
depends=$(OBJDIR)libAsm$(SOEXT)
cflags=-fPIE
ldflags=-L$(OBJDIR). -Wl,-rpath,$(LIBDIR) -lAsm -pie
install=$(BINDIR)

[deasm]
type=binary
sources=deasm.c
depends=$(OBJDIR)libAsm$(SOEXT)
cflags=-fPIE
ldflags=-L$(OBJDIR). -Wl,-rpath,$(LIBDIR) -lAsm -pie
install=$(BINDIR)

[arch.c]
depends=../include/Asm/arch.h,../include/Asm/asm.h,arch.h,code.h,../config.h
cppflags=-D PREFIX=\"$(PREFIX)\"

[asm.c]
depends=../include/Asm.h,arch.h,code.h,format.h,parser.h,../config.h
cppflags=-D PREFIX=\"$(PREFIX)\"

[code.c]
depends=../include/Asm.h,../include/Asm/arch.h,../include/Asm/asm.h,../include/Asm/format.h,arch.h,code.h,format.h,../config.h
cppflags=-D PREFIX=\"$(PREFIX)\"

[deasm.c]
depends=../include/Asm.h,../include/Asm/arch.h,../include/Asm/asm.h,../include/Asm/format.h

[format.c]
depends=../include/Asm/asm.h,../include/Asm/format.h,code.h,format.h,../config.h
cppflags=-D PREFIX=\"$(PREFIX)\"

[main.c]
depends=../include/Asm/asm.h,../config.h

[parser.c]
depends=parser.h,token.h

[token.c]
depends=common.h,token.h
