diff --git a/rules/base.mk b/rules/base.mk index 9ed8eae..d94c80c 100644 --- a/rules/base.mk +++ b/rules/base.mk @@ -47,8 +47,6 @@ endif @echo "[AR] $(notdir $@)" @$(AR) -rcs $@ $^ -%.elf: +%.elf: $(OFILES) @echo "[LD] $(notdir $@)" - @echo "[LD] $(LIBPATHS)" - @echo "[LD] $(LDFLAGS)" - @$(LD) -v $^ $(LIBPATHS) $(LIBS) $(LDFLAGS) -o $@ + @$(LD) $^ $(LIBPATHS) $(LIBS) $(LDFLAGS) -o $@ diff --git a/rules/rpl.mk b/rules/rpl.mk index d095da7..6725453 100644 --- a/rules/rpl.mk +++ b/rules/rpl.mk @@ -2,11 +2,10 @@ LIBPATHS := -L$(WUT_ROOT)/lib CFLAGS := -I$(WUT_ROOT)/include -fno-builtin -ffreestanding CXXFLAGS := $(CFLAGS) LDFLAGS := -nostdlib -nostartfiles $(WUT_ROOT)/lib/crt0.o -T $(WUT_ROOT)/rules/rpl.ld -pie -fPIE -z common-page-size=64 -z max-page-size=64 +ELF2RPL := $(WUT_ROOT)/bin/elf2rpl include $(WUT_ROOT)/rules/base.mk %.rpx: %.elf - @$(STRIP) $< -o $(BUILDDIR)/$(notdir $<) - -%.rpl: %.elf - @$(STRIP) $< -o $(BUILDDIR)/$(notdir $<) + @echo "[RPX] $(notdir $@)" + @$(ELF2RPL) $(BUILDDIR)/$(notdir $<) $@ diff --git a/samples/helloworld/Makefile b/samples/helloworld/Makefile index ec2b79b..0fec51e 100644 --- a/samples/helloworld/Makefile +++ b/samples/helloworld/Makefile @@ -22,7 +22,7 @@ ifneq ($(BUILD),$(notdir $(CURDIR))) export OUTPUT := $(CURDIR)/$(TARGET) export VPATH := $(foreach dir,$(SOURCE),$(CURDIR)/$(dir)) \ $(foreach dir,$(DATA),$(CURDIR)/$(dir)) -export BUILDDIR := $(CURDIR)/$(BUILD) +export BUILDDIR := $(CURDIR) export DEPSDIR := $(BUILDDIR) CFILES := $(foreach dir,$(SOURCE),$(notdir $(wildcard $(dir)/*.c))) @@ -55,6 +55,7 @@ else DEPENDS := $(OFILES:.o=.d) +$(OUTPUT).rpx: $(OUTPUT).elf $(OUTPUT).elf: $(OFILES) -include $(DEPENDS)