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.

64 lines
1.2 KiB

  1. # $Id$
  2. #
  3. # util -- miscellaneous utility routines
  4. #---------------------------------------------------------------------------
  5. .SUFFIXES: .c .o .u
  6. CC = gcc
  7. RANLIB = ranlib
  8. FLAGS = -DUNIX
  9. MFLAG =
  10. ICFLAGS = -g
  11. CFLAGS = $(ICFLAGS) $(MFLAG) $(XCFLAGS)
  12. LINTFLAGS = -u -n
  13. # this is to create the lint library
  14. LINTSWITCH = -o
  15. P = util
  16. PSRC = cpu_time.c cpu_stats.c safe_mem.c strsav.c texpand.c \
  17. ptime.c prtime.c pipefork.c pathsearch.c stub.c datalimit.c
  18. POBJ = $(PSRC:.c=.o)
  19. PUBJ = $(PSRC:.c=.u)
  20. PHDR = util.h
  21. WHERE = ..
  22. INCLUDE = $(WHERE)/include
  23. lib$(P).a: $(POBJ)
  24. ar rv $@ $?
  25. $(RANLIB) $@
  26. .c.o: $(PHDR)
  27. $(CC) -c $< -I$(INCLUDE) $(FLAGS) $(CFLAGS)
  28. optimize_dec: lib$(P).b
  29. lib$(P).b: $(PUBJ)
  30. ar rv $@ $?
  31. $(RANLIB) $@
  32. .c.u: $(PHDR)
  33. cc -j $< -I$(INCLUDE) $(FLAGS) $(XCFLAGS)
  34. # if the header files change, recompile
  35. $(POBJ): $(PHDR)
  36. $(PUBJ): $(PHDR)
  37. lint: llib-l$(P).ln
  38. llib-l$(P).ln: $(PSRC) $(PHDR)
  39. lint $(LINTFLAGS) $(LINTSWITCH)$(P) -I$(INCLUDE) $(PSRC)
  40. tags: $(PSRC) $(PHDR)
  41. ctags $(PSRC) $(PHDR)
  42. all: lib$(P).a lib$(P).b llib-l$(P).ln tags
  43. clean:
  44. rm -f *.o *.u core *.warnings
  45. distclean: clean
  46. rm -f lib$(P).a lib$(P).b llib-l$(P).ln tags *.bak *~ .pure