home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d110 / pdc.lha / Pdc / lib / Makefile < prev    next >
Makefile  |  1987-10-28  |  3KB  |  72 lines

  1. # STRING LIBRARY:
  2. #
  3. # Configuration settings:  how should "size_t", "void *", "const" be written?
  4. # "size_t" is what's needed to hold the result of sizeof; beware of problems
  5. # with compatibility here, because X3J11 uses this for e.g. the third
  6. # argument of strncpy() as well.  You may need to make it "int" even if
  7. # this is a lie.  "void *" is the generic pointer type, "char *" in most
  8. # existing implementations.  "const" is the keyword marking read-only
  9. # variables and parameters, unimplemented in most existing implementations.
  10. # These things need to be defined this way because they must be fitted into
  11. # both the .h files and the .c files; see the make instructions for string.h
  12. # farther down.
  13. SIZET = int
  14. VOIDSTAR = char *
  15. LVOIDSTAR = char*  # Lint shell file has problems with * alone.  Barf.
  16. CONST =
  17.  
  18. CONF = -DSIZET=$(SIZET) -DVOIDSTAR='$(VOIDSTAR)' -DCONST='$(CONST)'
  19. LCONF = -DSIZET=$(SIZET) -DVOIDSTAR='$(LVOIDSTAR)' -DCONST='$(CONST)'
  20.  
  21. # Things you might want to put in CFLAGS or LINTFLAGS.
  22. # -DCHARBITS=0377            Required if compiler lacks "unsigned char".
  23. # -Dvoid=int                           Required if compiler lacks "void".
  24. # -DUNIXERR                            Unix-like errno stuff, can test strerror().
  25. # -DBERKERR                            Like UNIXERR but for Berklix (4BSD).
  26. # -I.                                  string.h from here, not /usr/include.
  27.  
  28. CFLAGS = -O $(CONF) -DUNIXERR -I.
  29. LINTFLAGS = -hpan $(LCONF) -DUNIXERR -Dvoid=int -DCHARBITS=0377 -I.
  30. LDFLAGS = -i
  31.  
  32. # Name lists.
  33. STRING = index.o rindex.o strcat.o strchr.o strcmp.o strcpy.o strcspn.o \
  34.          strlen.o strncat.o strncmp.o strncpy.o strpbrk.o strrchr.o strspn.o \
  35.          strtok.o strstr.o memcpy.o memccpy.o memcmp.o memchr.o memset.o \
  36.          bcopy.o bcmp.o bzero.o strerror.o
  37. CSTRING = index.c rindex.c strcat.c strchr.c strcmp.c strcpy.c strcspn.c \
  38.          strlen.c strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strspn.c \
  39.          strtok.c strstr.c memcpy.c memccpy.c memcmp.c memchr.c memset.c \
  40.          bcopy.c bcmp.c bzero.c strerror.c
  41. DTR = README Makefile $(CSTRING) tester.c string.h.proto
  42.  
  43. # Locations, for installation (somewhat system-dependent).
  44. DEST=..
  45.  
  46. tester.o:          string.h
  47.  
  48. mv:      $(STRING)
  49.          mv $(STRING) $(DEST)
  50.  
  51. r:       tester
  52.          @echo 'No news is good news.  Note: strerror() test is VERY system-dependent.'
  53.          tester
  54.  
  55. tester:  tester.o $(STRING)
  56.          cc $(LDFLAGS) tester.o $(STRING) -o tester
  57.  
  58. string.h:          string.h.proto
  59.          sed 's/SIZET/$(SIZET)/g;s/VOIDSTAR /$(VOIDSTAR)/g' string.h.proto >string.h
  60.  
  61. memory.h:          string.h
  62.          egrep mem string.h >memory.h
  63.  
  64. lint:    string.h
  65.          lint $(LINTFLAGS) tester.c $(CSTRING)
  66.  
  67. clean:
  68.          rm -f tester a.out *.o string.h memory.h dtr
  69.  
  70. dtr:     $(DTR)
  71.          makedtr $(DTR) >dtr
  72.