Makefile.linux 471 B

123456789101112131415161718192021222324252627282930313233
  1. GCC=gcc
  2. AS=gcc
  3. LD=ld
  4. AR=ar
  5. HOSTCC=gcc
  6. CC=$(GCC)
  7. OBJCOPY=objcopy
  8. LDFLAGS=-static -s --no-gc-sections -N
  9. CFLAGS=-Wall -Os
  10. # For linux use c33. Only works on small endian systems
  11. CFLAGS+=-Iconfig/c33
  12. TARGETS=all
  13. all: lib/libfat.a lib/libtinyfat.a
  14. .c.o: $<
  15. $(GCC) -M $(CFLAGS) $< > $(<:.c=.d)
  16. $(GCC) $(CFLAGS) -c $< -o $(<:.c=.o)
  17. lib/libfat.a: src/ff.o
  18. $(AR) q $@ $^
  19. lib/libtinyfat.a: src/tff.o
  20. $(AR) q $@ $^
  21. clean:
  22. $(RM) src/*.d
  23. $(RM) src/*.o
  24. $(RM) lib/*.a