diff --git a/CEdev/examples/template/Makefile b/CEdev/examples/template/Makefile index b55055cd2..dbcc3c9a0 100644 --- a/CEdev/examples/template/Makefile +++ b/CEdev/examples/template/Makefile @@ -1,4 +1,6 @@ +REALWINPATH = $(subst /,\,$(realpath $(1))) CEDEV ?= .. +CEDEV := $(call REALWINPATH,$(CEDEV)) BIN = $(CEDEV)\bin INCLUDE = $(CEDEV)\include WORKDIR ?= src @@ -43,7 +45,8 @@ $(TARGET).hex : $(OBJECTS) $(STARTUPMODULE) $(LIBRARIES) $(CV) $(@:%.8xp=%) %.obj : %.c - $(CC) $(CFLAGS) $< + cd $(dir $@) && \ + $(CC) $(CFLAGS) $(notdir $<) %.obj : %.asm $(CC) $(CFLAGS) $< @@ -51,4 +54,4 @@ $(TARGET).hex : $(OBJECTS) $(STARTUPMODULE) $(LIBRARIES) clean : $(RM) $(wildcard *.src *.obj $(TARGET).*) -.PHONY : all clean \ No newline at end of file +.PHONY : all clean