subdirs=browser,desktop
targets=copy,delete,move,open,properties,view
cppflags_force=-I../include
cflags_force=`pkg-config --cflags libDesktop`
cflags=-W -Wall -g -O2 -fPIE -D_FORTIFY_SOURCE=2 -fstack-protector
ldflags_force=`pkg-config --libs libDesktop` -lintl
ldflags=-pie -Wl,-z,relro -Wl,-z,now
dist=Makefile,common.c,common.h

#modes
[mode::embedded-debug]
cppflags_force=-I../include -DEMBEDDED

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

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

#targets
[copy]
type=binary
sources=copy.c
ldflags=-L$(OBJDIR)lib -Wl,-rpath,$(PREFIX)/lib -lBrowser
depends=$(OBJDIR)lib/libBrowser.a
install=$(BINDIR)

[delete]
type=binary
sources=delete.c
ldflags=-L$(OBJDIR)lib -Wl,-rpath,$(PREFIX)/lib -lBrowser
depends=$(OBJDIR)lib/libBrowser.a
install=$(BINDIR)

[move]
type=binary
sources=move.c
ldflags=-L$(OBJDIR)lib -Wl,-rpath,$(PREFIX)/lib -lBrowser
depends=$(OBJDIR)lib/libBrowser.a
install=$(BINDIR)

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

[properties]
type=binary
depends=$(OBJDIR)lib/libBrowser.a
sources=properties.c
ldflags=-L$(OBJDIR)lib -Wl,-rpath,$(PREFIX)/lib -lBrowser
install=$(BINDIR)

[view]
type=binary
depends=$(OBJDIR)lib/libBrowser.a
sources=view.c
ldflags=-L$(OBJDIR)lib -Wl,-rpath,$(PREFIX)/lib -lBrowser
install=$(BINDIR)

#sources
[copy.c]
depends=../include/Browser/vfs.h

[delete.c]
depends=../include/Browser/vfs.h

[move.c]
depends=../include/Browser/vfs.h

[properties.c]
depends=../include/Browser.h,browser/browser.h,common.c
cppflags=-D PREFIX=\"$(PREFIX)\"

[view.c]
depends=browser/browser.h,common.c
