targets=panel-embed,panel-message,panel-notify,panel-test,settings,wifibrowser
cflags_force=`pkg-config --cflags libDesktop`
cflags=-W -Wall -g -O2 -pedantic -fPIE -D_FORTIFY_SOURCE=2 -fstack-protector
ldflags_force=`pkg-config --libs libDesktop`
ldflags=-pie -Wl,-z,relro -Wl,-z,now
dist=Makefile,helper.c,subst.sh

#modes
[mode::embedded-debug]
cppflags_force=-DEMBEDDED

[mode::embedded-release]
cppflags_force=-DEMBEDDED -DNDEBUG
cflags=-W -Wall -O2 -pedantic -fPIE -D_FORTIFY_SOURCE=2 -fstack-protector

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

#targets
[panel-embed]
type=binary
cppflags=-D PREFIX=\"$(PREFIX)\"
sources=embed.c
install=$(BINDIR)

[panel-message]
type=binary
cppflags=-D PREFIX=\"$(PREFIX)\"
#for Gtk+ 3
#cflags=`pkg-config --cflags gtk+-x11-3.0`
#ldflags=`pkg-config --libs gtk+-x11-3.0`
sources=message.c
install=$(BINDIR)

[panel-notify]
type=binary
cppflags=-D PREFIX=\"$(PREFIX)\"
#for Gtk+ 3
#cflags=`pkg-config --cflags gtk+-x11-3.0`
#ldflags=`pkg-config --libs gtk+-x11-3.0` -L../src -L$(OBJDIR). -Wl,-rpath,$(PREFIX)/lib -lPanel
ldflags=-L../src -L$(OBJDIR). -Wl,-rpath,$(PREFIX)/lib -lPanel
sources=notify.c
install=$(BINDIR)

[panel-test]
type=binary
cppflags=-D PREFIX=\"$(PREFIX)\"
ldflags=-L../src -L$(OBJDIR). -Wl,-rpath,$(PREFIX)/lib -lPanel
sources=test.c

[settings]
type=binary
sources=settings.c
install=$(BINDIR)

[wifibrowser]
type=binary
cppflags=-I ../include
ldflags=-L../src -L$(OBJDIR). -Wl,-rpath,$(PREFIX)/lib -lPanel
sources=wifibrowser.c
install=$(BINDIR)

#sources
[embed.c]
depends=../include/Panel.h,../config.h

[message.c]
depends=../include/Panel.h,../config.h

[notify.c]
depends=helper.c,../src/helper.c,../src/panel.h,../config.h

[settings.c]
depends=../config.h

[test.c]
depends=helper.c,../src/helper.c,../src/panel.h,../config.h

[wifibrowser.c]
depends=../src/applets/wpa_supplicant.c,../config.h
