subdirs=scripts
#XXX the "makefile.o" target is necessary to workaround an issue on some systems
targets=configure,makedepend,makefile.o
cppflags=
cflags_force=`pkg-config --cflags libSystem`
cflags=-W -Wall -g -O2 -fPIE -D_FORTIFY_SOURCE=2 -fstack-protector
ldflags_force=`pkg-config --libs libSystem`
ldflags=-pie -Wl,-z,relro -Wl,-z,now
dist=Makefile,common.h,configure.h,makefile.h,settings.h

#modes
[mode::release]
cppflags_force=-DNDEBUG
cflags=-W -Wall -O2 -fPIE -D_FORTIFY_SOURCE=2 -fstack-protector

#targets
[configure]
type=binary
depends=$(OBJDIR)makefile.o
sources=common.c,configure.c,settings.c,main.c
ldflags=$(OBJDIR)makefile.o
install=$(BINDIR)

[makedepend]
type=binary
sources=makedepend.c

[makefile.o]
type=object
sources=makefile.c

#sources
[common.c]
depends=common.h

[configure.c]
cppflags=-D PREFIX=\"$(PREFIX)\"
depends=common.h,configure.h,makefile.h,../config.h

[main.c]
depends=configure.h

[settings.c]
depends=settings.h

[makefile.c]
depends=configure.h,settings.h,../config.h
