# where is the source tree
PCBSRC=${HOME}/src/pcb/pcb
# where to put the compiled plugin
PLUGINDIR = ${HOME}/.pcb/plugins

PLUGINNAME = myplugin

# compiler to use
CC = gcc
# base compile flags
CFLAGS = -fPIC -O2 
# includes for glib
CFLAGS += `pkg-config --cflags glib-2.0`
# includes for gtk
#CFLAGS += `pkg-config --cflags gtk+-2.0`
#includes for pcb
CFLAGS += -I${PCBSRC} -I${PCBSRC}/src -DHAVE_CONFIG_H

# for linux or windows
CFLAGS += -shared
# for mac os
#CFLAGS += -dynamiclib -Wl,-undefined,dynamic_lookup

${PLUGINNAME}.so: ${PLUGINNAME}.c
	${CC} ${CFLAGS} $^ -o $@
	file $@

install: ${PLUGINNAME}.so
	install -m 0755 -D $^ ${PLUGINDIR}

