# QMK for TencentOS # @author Jimmin.huang jimmin@163.com # Makefile template ######################################################################## .SECONDARY:: ${BOBJS} ifndef lib lib = lib$(shell basename ${LOCALDIR}) endif targetlib = ${LIBDIR}/${lib}.a ${LIBDIR}/%.a: ${BOBJS} ifeq (@,$(Q)) @$(ECHO) "[$(BP)] ARLIB $(subst $(QTOP)/,,$@)" endif $Q$(RM) $@ $Q$(AR) ${ARFLAGS} $@ $(sort ${BOBJS}) # if objs is not empty, let make .a ifneq (,$(strip ${BOBJS})) all:: ${BLDDIR}/.tree ${targetlib} $(targetlib): ${BOBJS} ifneq (,${BOBJS}) ifeq (@,$(Q)) @$(ECHOE) "[$(BP)] ARLIB \e[1;32m$(subst $(QTOP)/,,$@) \e[m" endif $Q$(RM) $@ $Q$(AR) ${ARFLAGS} $@ $(sort ${BOBJS}) endif install:: all clean:: ifeq (@,$(Q)) $Q$(ECHO) "[$(BP)] ClEAN OBJS ${LOCALDIR}" endif $Q$(RM) ${BOBJS} ifdef EEEE $Q$(RM) ${BOBJS:.o=.i} endif $Q$(RM) ${targetlib} distclean:: clean endif