2 # Acess2 Module/Driver Templater Makefile
5 -include ../../Makefile.cfg
7 CPPFLAGS = -I../../Kernel/include -I../../Kernel/arch/$(ARCHDIR)/include -DARCH=$(ARCH)
8 CFLAGS = -Wall -Werror $(CPPFLAGS)
10 OBJ := $(addsuffix .$(ARCH),$(OBJ))
11 BIN = ../$(NAME).kmd.$(ARCH)
12 KOBJ = ../$(NAME).xo.$(ARCH)
14 DEPFILES = $(filter %.o.$(ARCH),$(OBJ))
15 DEPFILES := $(DEPFILES:%.o.$(ARCH)=%.d.$(ARCH))
22 $(RM) $(BIN) $(KOBJ) $(OBJ) $(DEPFILES)
26 @$(LD) -T ../link.ld -shared -o $@ $(OBJ)
27 @echo --- $(LD) -o $(KOBJ)
28 @$(CC) -Wl,-r -nostdlib -o $(KOBJ) $(OBJ)
30 %.o.$(ARCH): %.c Makefile ../Makefile.tpl ../../Makefile.cfg
32 @$(CC) $(CFLAGS) -o $@ -c $<
33 @$(CC) -M $(CPPFLAGS) -MT $@ -o $*.d.$(ARCH) $<