include ${S}/Makefile.inc # KERNSRCS use kernel headers # STDSRCS are normal userspace sources # they are set by the including makefile (not by ${S}/Makefile.inc) # this Makefile.inc builds only KERNSRCS, STDSRCS are built by Makefile.std SRCS += ${STDSRCS} ${KERNSRCS} all: ${PROG} $(KERNSRCS:.c=.d): %.d: %.c ${CC} -M ${CPPFLAGS} -E $< > $@ include $(KERNSRCS:.c=.d) ${PROG}: ${KERNLIB} $(SRCS:.c=.o) ${CC} -o $@ $(SRCS:.c=.o) ${KERNLIB} $(STDSRCS:.c=.o): %.o: %.c ${MAKE} -f Makefile.std $(@F) ${KERNLIB}: FORCE ${MAKE} -C ${S} FORCE: clean: ${RM} $(SRCS:.c=.o) $(SRCS:.c=.d) ${PROG}