_CPPFLAGS := $(CPPFLAGS)
-CFGFILES :=
-CFGFILES += $(shell test -f ../../../Makefile.cfg && echo ../../../Makefile.cfg)
-CFGFILES += $(shell test -f ../../Makefile.cfg && echo ../../Makefile.cfg)
-CFGFILES += $(shell test -f ../Makefile.cfg && echo ../Makefile.cfg)
-CFGFILES += $(shell test -f Makefile.cfg && echo Makefile.cfg)
--include $(CFGFILES)
+-include $(dir $(lastword $(MAKEFILE_LIST)))../Makefile.cfg
CPPFLAGS := -I$(ACESSDIR)/Kernel/include -I$(ACESSDIR)/Kernel/arch/$(ARCHDIR)/include -DARCH=$(ARCH) $(_CPPFLAGS)
CFLAGS := -Wall -Werror -fno-stack-protector -g -O3 -fno-builtin
install: $(BIN)
ifneq ($(BUILDTYPE),static)
- $(xCP) $(BIN) $(DISTROOT)/Modules/$(NAME).kmd.$(ARCH)
+ @$(xMKDIR) $(DISTROOT)/Modules/$(ARCH); true
+ $(xCP) $(BIN) $(DISTROOT)/Modules/$(ARCH)/$(NAME).kmd
else
endif
@$(LD) -r -o $@ $(OBJ)
endif
-%.o.$(_SUFFIX): %.c Makefile ../Makefile.tpl $(CFGFILES)
+%.o.$(_SUFFIX): %.c Makefile $(CFGFILES)
@echo --- $(CC) -o $@
@$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
@$(CC) -M $(CPPFLAGS) -MT $@ -o $*.d.$(ARCH) $<