1TOP?= ../ 2include ${TOP}/Makefile.inc 3include ${TOP}/config.mk 4 5CFLAGS?= -O2 6CSTD?= c99 7CFLAGS+= -std=${CSTD} 8 9DEVDIR= ${LIBDIR}/dhcpcd/dev 10DSRC= ${DEV_PLUGINS:=.c} 11DOBJ= ${DSRC:.c=.o} 12DSOBJ= ${DOBJ:.o=.So} 13DPLUGS= ${DEV_PLUGINS:=.so} 14 15CLEANFILES+= ${DSOBJ} ${DPLUGS} 16 17.SUFFIXES: .So .so 18 19.c.So: 20 ${CC} ${PICFLAG} -DPIC ${CPPFLAGS} ${CFLAGS} -c $< -o $@ 21 22.So.so: ${DSOBJ} 23 ${CC} ${LDFLAGS} -shared -Wl,-x -o $@ -Wl,-soname,$@ \ 24 $< ${LIBS} 25 26all: ${DPLUGS} 27 28udev.So: 29CFLAGS+= ${LIBUDEV_CFLAGS} 30CPPFLAGS+= ${LIBUDEV_CPPFLAGS} 31 32udev.so: 33LIBS+= ${LIBUDEV_LIBS} 34 35proginstall: ${DPLUGS} 36 ${INSTALL} -d ${DESTDIR}${DEVDIR} 37 ${INSTALL} -m ${BINMODE} ${PROG} ${DPLUGS} ${DESTDIR}${DEVDIR} 38 39install: proginstall 40 41clean: 42 rm -f ${CLEANFILES} 43