
RC = windres

PLUGIN = PADwin.dll
CFLAGS = -Wall -O2 -fomit-frame-pointer -D__WIN32__ -D__MINGW32__
LIBS   = -lcomctl32 -lwsock32 -lwinmm -lgdi32 -lcomdlg32
RESOBJ = PADwnKeyb.o
OBJS   = PAD.o Conf.o Win32.o ${RESOBJ}
STRIP  = strip

DEPS:= $(OBJS:.o=.d)

all: plugin

plugin: ${OBJS}
	dllwrap --def plugin.def -o ${PLUGIN} ${OBJS} ${LIBS}
#	${CC} -shared -Wl,--kill-at,--output-def,plugin.def ${CFLAGS} ${OBJS} -o ${PLUGIN} ${LIBS}
	${STRIP} ${PLUGIN}

.PHONY: clear plugin

clean: 
	rm -f ${OBJS} ${DEPS} ${PLUGIN}

${RESOBJ}: PADwnKeyb.rc
	${RC} -D__MINGW32__ -J rc -Imingw -O coff -o $@ -i $<

-include ${DEPS}

