1 TOP?= ../ 2 include ${TOP}/Makefile.inc 3 include ${TOP}/config.mk 4 5 CFLAGS?= -O2 6 CSTD?= c99 7 CFLAGS+= -std=${CSTD} 8 9 DEVDIR= ${LIBDIR}/dhcpcd/dev 10 DSRC= ${DEV_PLUGINS:=.c} 11 DOBJ= ${DSRC:.c=.o} 12 DSOBJ= ${DOBJ:.o=.So} 13 DPLUGS= ${DEV_PLUGINS:=.so} 14 15 CLEANFILES+= ${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 26 all: ${DPLUGS} 27 28 udev.So: 29 CFLAGS+= ${LIBUDEV_CFLAGS} 30 CPPFLAGS+= ${LIBUDEV_CPPFLAGS} 31 32 udev.so: 33 LIBS+= ${LIBUDEV_LIBS} 34 35 proginstall: ${DPLUGS} 36 ${INSTALL} -d ${DESTDIR}${DEVDIR} 37 ${INSTALL} -m ${BINMODE} ${PROG} ${DPLUGS} ${DESTDIR}${DEVDIR} 38 39 install: proginstall 40 41 clean: 42 rm -f ${CLEANFILES} 43