-L$(M2DIR)/software/libnet \
-L$(M2DIR)/software/libbase \
-L$(M2DIR)/software/libcompiler-rt \
- -lnet -lbase -lcompiler-rt
+ -lnet -lbase-nofloat -lcompiler-rt
chmod -x $@
main.o: main.c
# http://scottmcpeak.com/autodepend/autodepend.html
define compilexx-dep
-$(CX) -c $(CXXFLAGS) $< -o $*.o
-@$(CX_normal) -MM $(CXXFLAGS) $< > $*.d
+$(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 | \
endef
define compile-dep
-$(CC) -c $(CFLAGS) $< -o $*.o
-@$(CC_normal) -MM $(CFLAGS) $< > $*.d
+$(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 | \
M2DIR=../..
include $(M2DIR)/software/common.mak
-OBJECTS=setjmp.o libc.o errno.o crc16.o crc32.o console.o system.o board.o uart.o vsnprintf.o strtod.o qsort.o
+OBJECTS=setjmp.o libc.o errno.o crc16.o crc32.o console.o system.o board.o uart.o qsort.o strtod.o
-all: libbase.a
+all: libbase.a libbase-nofloat.a
# pull in dependency info for *existing* .o files
-include $(OBJECTS:.o=.d)
-libbase.a: $(OBJECTS)
- $(AR) clr libbase.a $(OBJECTS)
+libbase.a: $(OBJECTS) vsnprintf.o
+ $(AR) clr libbase.a $(OBJECTS) vsnprintf.o
$(RANLIB) libbase.a
+libbase-nofloat.a: $(OBJECTS) vsnprintf-nofloat.o
+ $(AR) clr libbase-nofloat.a $(OBJECTS) vsnprintf-nofloat.o
+ $(RANLIB) libbase-nofloat.a
+
+vsnprintf-nofloat.o: vsnprintf.c
+ $(call compile-dep,-DNO_FLOAT)
+
%.o: %.c
$(compile-dep)
.PHONY: clean
clean:
- $(RM) $(OBJECTS) $(OBJECTS:.o=.ts) $(OBJECTS:.o=.d) libbase.a .*~ *~
+ $(RM) $(OBJECTS) $(OBJECTS:.o=.d) vsnprintf.o vsnprintf.d vsnprintf-nofloat.o vsnprintf-nofloat.d
+ $(RM) libbase.a libbase-nofloat.a .*~ *~
16, field_width, precision, flags);
continue;
+#ifndef NO_FLOAT
case 'g':
case 'f': {
int m;
continue;
}
+#endif
case 'n':
/* FIXME: