SRCS = $(sort $(wildcard src/*/*.c)) OBJS = $(SRCS:.c=.o) CFLAGS = -Os -ffloat-store -nostdinc -ffreestanding -std=c99 -D_XOPEN_SOURCE=700 -pipe INC = -I./include -I./src/internal -I./arch/$(ARCH) AR = $(CROSS_COMPILE)ar RANLIB = $(CROSS_COMPILE)ranlib OBJCOPY = $(CROSS_COMPILE)objcopy STATIC_LIBS = lib/libm.a ALL_LIBS = $(STATIC_LIBS) -include config.mak all: $(ALL_LIBS) clean: rm -f $(OBJS) rm -f $(ALL_LIBS) lib/*.[ao] lib/*.so rm -f include/bits include/bits: @test "$(ARCH)" || { echo "Please set ARCH in config.mak before running make." ; exit 1 ; } ln -sf ../arch/$(ARCH)/bits $@ include/bits/alltypes.h.sh: include/bits include/bits/alltypes.h: include/bits/alltypes.h.sh sh $< > $@ %.o: $(ARCH)/%.s $(CC) $(CFLAGS) $(INC) -c -o $@ $< %.o: %.c include/bits/alltypes.h $(CC) $(CFLAGS) $(INC) -c -o $@ $< lib/libm.a: $(OBJS) rm -f $@ $(AR) rc $@ $(OBJS) $(RANLIB) $@