_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 $(CPPFLAGS) -O3 -fno-builtin
+CFLAGS := -Wall -Werror -fno-stack-protector -g -O3 -fno-builtin
ifneq ($(CATEGORY),)
FULLNAME := $(CATEGORY)_$(NAME)
install: $(BIN)
ifneq ($(BUILDTYPE),static)
- $(xCP) $(BIN) $(DISTROOT)/Modules/$(NAME).kmd.$(ARCH)
+ $(xMKDIR) $(DISTROOT)/Modules/$(ARCH)
+ $(xCP) $(BIN) $(DISTROOT)/Modules/$(ARCH)/$(NAME).kmd
else
endif
%.o.$(_SUFFIX): %.c Makefile ../Makefile.tpl $(CFGFILES)
@echo --- $(CC) -o $@
- @$(CC) $(CFLAGS) -o $@ -c $<
+ @$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
@$(CC) -M $(CPPFLAGS) -MT $@ -o $*.d.$(ARCH) $<
-include $(DEPFILES)