2 # Acess2 Module/Driver Templater Makefile
5 _CPPFLAGS := $(CPPFLAGS)
7 -include ../../Makefile.cfg
9 CPPFLAGS = -I../../Kernel/include -I../../Kernel/arch/$(ARCHDIR)/include -DARCH=$(ARCH) $(_CPPFLAGS)
10 CFLAGS = -Wall -Werror -fno-stack-protector $(CPPFLAGS)
12 OBJ := $(addsuffix .$(ARCH),$(OBJ))
13 BIN = ../$(NAME).kmd.$(ARCH)
14 KOBJ = ../$(NAME).xo.$(ARCH)
16 DEPFILES = $(filter %.o.$(ARCH),$(OBJ))
17 DEPFILES := $(DEPFILES:%.o.$(ARCH)=%.d.$(ARCH))
24 $(RM) $(BIN) $(BIN).dsm $(KOBJ) $(OBJ) $(DEPFILES)
28 @$(LD) -T ../link.ld -shared -nostdlib -o $@ $(OBJ)
29 # @$(LD) -shared -nostdlib -o $@ $(OBJ)
30 @$(OBJDUMP) -d $(BIN) > $(BIN).dsm
31 $(xCP) $@ $(DISTROOT)/Modules/$(NAME).kmd
32 @echo --- $(LD) -o $(KOBJ)
33 @$(CC) -Wl,-r -nostdlib -o $(KOBJ) $(OBJ)
35 %.o.$(ARCH): %.c Makefile ../Makefile.tpl ../../Makefile.cfg
37 @$(CC) $(CFLAGS) -o $@ -c $<
38 @$(CC) -M $(CPPFLAGS) -MT $@ -o $*.d.$(ARCH) $<