subdirs=lib
targets=cpp
cppflags_force=-I ../include
cppflags=
cflags_force=`pkg-config --cflags libSystem` -fPIE
cflags=-W -Wall -g -O2 -pedantic -D_FORTIFY_SOURCE=2 -fstack-protector
ldflags_force=`pkg-config --libs libSystem`
ldflags=-pie -Wl,-z,relro -Wl,-z,now
dist=Makefile

#modes
[mode::debug]

[mode::release]
cppflags_force=-I ../include -DNDEBUG
cflags=-W -Wall -O2 -pedantic -D_FORTIFY_SOURCE=2 -fstack-protector

#targets
[cpp]
type=binary
sources=main.c
#XXX should really use this (race condition with "make -k")
depends=$(OBJDIR)lib/libcpp$(SOEXT)
depends=$(OBJDIR)lib/libcpp.a
ldflags=-L$(OBJDIR)lib -L$(LIBDIR) -Wl,-rpath,$(LIBDIR) -lcpp
install=$(BINDIR)

#sources
[main.c]
depends=../include/CPP.h
