all: bios.bin
-# pull in dependency info for *existing* .o files
--include $(OBJECTS:.o=.d)
-
%.bin: %.elf
$(OBJCOPY) -O binary $< $@
chmod -x $@
chmod -x $@
main.o: $(BIOS_DIRECTORY)/main.c
- $(compile-dep)
+ $(compile)
%.o: $(BIOS_DIRECTORY)/%.c
- $(compile-dep)
+ $(compile)
%.o: $(BIOS_DIRECTORY)/%.S
$(assemble)
clean:
- $(RM) $(OBJECTS) $(OBJECTS:.o=.d) bios.elf bios.bin .*~ *~
+ $(RM) $(OBJECTS) bios.elf bios.bin .*~ *~
-.PHONY: all main.o clean
+.PHONY: all clean main.o
# compile and generate dependencies, based on
# http://scottmcpeak.com/autodepend/autodepend.html
-define compilexx-dep
-$(CX) -c $(CXXFLAGS) $(1) $< -o $*.o
-@$(CX_normal) -MM $(CXXFLAGS) $(1) $< > $*.d
-@mv -f $*.d $*.d.tmp
-@sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
-@sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
- sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
-@rm -f $*.d.tmp
+define compilexx
+$(CX) -c $(CXXFLAGS) $(1) $< -o $@
endef
-define compile-dep
-$(CC) -c $(CFLAGS) $(1) $< -o $*.o
-@$(CC_normal) -MM $(CFLAGS) $(1) $< > $*.d
-@mv -f $*.d $*.d.tmp
-@sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
-@sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
- sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
-@rm -f $*.d.tmp
+define compile
+$(CC) -c $(CFLAGS) $(1) $< -o $@
endef
define assemble
-$(CC) -c $(CFLAGS) -o $*.o $<
+$(CC) -c $(CFLAGS) -o $@ $<
endef
all: crt0-$(CPU).o libbase.a libbase-nofloat.a
-# pull in dependency info for *existing* .o files
--include $(OBJECTS:.o=.d)
-
libbase.a: $(OBJECTS) vsnprintf.o
$(AR) crs libbase.a $(OBJECTS) vsnprintf.o
$(AR) crs libbase-nofloat.a $(OBJECTS) vsnprintf-nofloat.o
vsnprintf-nofloat.o: $(LIBBASE_DIRECTORY)/vsnprintf.c
- $(call compile-dep,-DNO_FLOAT)
+ $(call compile,-DNO_FLOAT)
%.o: $(LIBBASE_DIRECTORY)/%.c
- $(compile-dep)
+ $(compile)
%.o: $(LIBBASE_DIRECTORY)/%.S
$(assemble)
-.PHONY: clean
+.PHONY: all clean
clean:
- $(RM) $(OBJECTS) $(OBJECTS:.o=.d) crt0-$(CPU).o vsnprintf.o vsnprintf.d vsnprintf-nofloat.o vsnprintf-nofloat.d
+ $(RM) $(OBJECTS) crt0-$(CPU).o vsnprintf.o vsnprintf-nofloat.o
$(RM) libbase.a libbase-nofloat.a .*~ *~
all: libcompiler_rt.a
-# pull in dependency info for *existing* .o files
--include $(OBJECTS:.o=.d)
-
libcompiler_rt.a: $(OBJECTS)
$(AR) crs libcompiler_rt.a $(OBJECTS)
%.o: $(MISOC_DIRECTORY)/software/compiler_rt/lib/builtins/%.c
- $(compile-dep)
+ $(compile)
-.PHONY: clean
+.PHONY: all clean
clean:
$(RM) $(OBJECTS) $(OBJECTS:.o=.ts) $(OBJECTS:.o=.d) libcompiler_rt.a .*~ *~
all: $(ALL_TARGET)
-# pull in dependency info for *existing* .o files
--include $(OBJECTS:.o=.d)
-
libdyld.a: $(OBJECTS)
$(AR) crs libdyld.a $(OBJECTS)
%.o: $(LIBDYLD_DIRECTORY)/%.c
- $(compile-dep)
+ $(compile)
-.PHONY: clean
+.PHONY: all clean
clean:
- $(RM) $(OBJECTS) $(OBJECTS:.o=.d) libdyld.a .*~ *~
+ $(RM) $(OBJECTS) libdyld.a .*~ *~
all: libnet.a
-# pull in dependency info for *existing* .o files
--include $(OBJECTS:.o=.d)
-
libnet.a: $(OBJECTS)
$(AR) crs libnet.a $(OBJECTS)
%.o: $(LIBNET_DIRECTORY)/%.c
- $(compile-dep)
+ $(compile)
%.o: %.S
$(assemble)
-.PHONY: clean
+.PHONY: all clean
clean:
- $(RM) $(OBJECTS) $(OBJECTS:.o=.ts) $(OBJECTS:.o=.d) libnet.a .*~ *~
+ $(RM) $(OBJECTS) libnet.a .*~ *~
all: $(ALL_TARGET)
-# pull in dependency info for *existing* .o files
--include $(OBJECTS:.o=.d)
-
libunwind.a: $(OBJECTS)
$(AR) crs libunwind.a $(OBJECTS)
%.o: $(MISOC_DIRECTORY)/software/unwinder/src/%.cpp
- $(compilexx-dep)
+ $(compilexx)
%.o: $(MISOC_DIRECTORY)/software/unwinder/src/%.c
- $(compile-dep)
+ $(compile)
%.o: $(MISOC_DIRECTORY)/software/unwinder/src/%.S
$(assemble)
.PHONY: clean
clean:
- $(RM) $(OBJECTS) $(OBJECTS:.o=.ts) $(OBJECTS:.o=.d) libunwind.a .*~ *~
+ $(RM) $(OBJECTS) libunwind.a .*~ *~
all: memtest.bin
-# pull in dependency info for *existing* .o files
--include $(OBJECTS:.o=.d)
-
%.bin: %.elf
$(OBJCOPY) -O binary $< $@
chmod -x $@
chmod -x $@
main.o: main.c
- $(compile-dep)
+ $(compile)
%.o: %.c
- $(compile-dep)
+ $(compile)
%.o: %.S
$(assemble)
clean:
- $(RM) $(OBJECTS) $(OBJECTS:.o=.d) memtest.elf memtest.bin
+ $(RM) $(OBJECTS) memtest.elf memtest.bin
$(RM) .*~ *~
.PHONY: all main.o clean libs load