Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

89 lines
2.7 KiB

  1. all: t byte.a fmt.a scan.a str.a uint.a open.a stralloc.a unix.a socket.a buffer.a mmap.a libowfat.a
  2. VPATH=str:byte:fmt:scan:uint:open:stralloc:unix:socket:buffer:mmap
  3. # comment out the following line if you don't want to build with the
  4. # diet libc (http://www.fefe.de/dietlibc/).
  5. DIET=diet -Os
  6. CC=gcc
  7. CFLAGS=-I. -pipe -Wall -O2 -pipe -fomit-frame-pointer
  8. #CFLAGS=-pipe -Os -march=pentiumpro -mcpu=pentiumpro -fomit-frame-pointer -fschedule-insns2 -Wall
  9. BYTE_OBJS=$(patsubst byte/%.c,%.o,$(wildcard byte/*.c))
  10. FMT_OBJS=$(patsubst fmt/%.c,%.o,$(wildcard fmt/*.c))
  11. SCAN_OBJS=$(patsubst scan/%.c,%.o,$(wildcard scan/*.c))
  12. STR_OBJS=$(patsubst str/%.c,%.o,$(wildcard str/*.c))
  13. UINT_OBJS=$(patsubst uint/%.c,%.o,$(wildcard uint/*.c))
  14. OPEN_OBJS=$(patsubst open/%.c,%.o,$(wildcard open/*.c))
  15. STRA_OBJS=$(patsubst stralloc/%.c,%.o,$(wildcard stralloc/*.c))
  16. UNIX_OBJS=$(patsubst unix/%.c,%.o,$(wildcard unix/*.c))
  17. SOCKET_OBJS=$(patsubst socket/%.c,%.o,$(wildcard socket/*.c))
  18. BUFFER_OBJS=$(patsubst buffer/%.c,%.o,$(wildcard buffer/*.c))
  19. MMAP_OBJS=$(patsubst mmap/%.c,%.o,$(wildcard mmap/*.c))
  20. $(BYTE_OBJS): byte.h
  21. $(FMT_OBJS): fmt.h
  22. $(SCAN_OBJS): scan.h
  23. $(STR_OBJS): str.h
  24. $(UINT_OBJS): uint16.h uint32.h
  25. $(STRA_OBJS): stralloc.h
  26. $(SOCKET_OBJS): socket.h
  27. $(BUFFER_OBJS): buffer.h
  28. $(MMAP_OBJS): mmap.h
  29. byte.a: $(BYTE_OBJS)
  30. fmt.a: $(FMT_OBJS)
  31. scan.a: $(SCAN_OBJS)
  32. str.a: $(STR_OBJS)
  33. uint.a: $(UINT_OBJS)
  34. open.a: $(OPEN_OBJS)
  35. stralloc.a: $(STRA_OBJS)
  36. unix.a: $(UNIX_OBJS)
  37. socket.a: $(SOCKET_OBJS)
  38. buffer.a: $(BUFFER_OBJS)
  39. mmap.a: $(MMAP_OBJS)
  40. libowfat.a: $(BYTE_OBJS) $(FMT_OBJS) $(SCAN_OBJS) $(STR_OBJS) \
  41. $(UINT_OBJS) $(OPEN_OBJS) $(STRA_OBJS) $(UNIX_OBJS) $(SOCKET_OBJS) \
  42. $(BUFFER_OBJS) $(MMAP_OBJS)
  43. %.a:
  44. ar cr $@ $^
  45. -ranlib $@
  46. t: t.o socket.a stralloc.a buffer.a scan.a uint.a mmap.a open.a fmt.a \
  47. str.a byte.a
  48. $(DIET) $(CC) -g -o $@ $^
  49. .PHONY: clean tar
  50. clean:
  51. rm -f *.o *.a core t haveip6.h haven2i.h
  52. VERSION=libowfat-$(shell head -1 CHANGES|sed 's/://')
  53. CURNAME=$(notdir $(shell pwd))
  54. tar: clean rename
  55. cd ..; tar cvvf $(VERSION).tar.bz2 $(VERSION) --use=bzip2 --exclude CVS
  56. rename:
  57. if test $(CURNAME) != $(VERSION); then cd .. && mv $(CURNAME) $(VERSION); fi
  58. haveip6.h:
  59. -rm -f $@
  60. if $(DIET) $(CC) -c tryip6.c >/dev/null 2>&1; then echo "#define LIBC_HAS_IP6"; fi > $@
  61. haven2i.h:
  62. -rm -f $@
  63. if $(DIET) $(CC) -o t tryn2i.c >/dev/null 2>&1; then echo "#define HAVE_N2I"; fi > $@
  64. havesl.h:
  65. -rm -f $@
  66. if $(DIET) $(CC) -o t trysl.c >/dev/null 2>&1; then echo "#define HAVE_SOCKLEN_T"; fi > $@
  67. socket_accept6.o socket_connect6.o socket_local6.o socket_mchopcount6.o \
  68. socket_mcjoin6.o socket_mcleave6.o socket_mcloop6.o socket_recv6.o \
  69. socket_remote6.o socket_send6.o socket_tcp6.o socket_udp6.o: haveip6.h
  70. socket_getifidx.o socket_getifname.o: haven2i.h