home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume26 / sysinfo-1.0 / part01 / Makefile < prev    next >
Encoding:
Makefile  |  1993-04-10  |  3.7 KB  |  156 lines

  1. #
  2. # Copyright (c) 1992 Michael A. Cooper.
  3. # This software may be freely distributed provided it is not sold for 
  4. # profit and the author is credited appropriately.
  5. #
  6. # $Header: /src/common/usc/bin/sysinfo/RCS/Makefile,v 1.8 1992/04/26 23:31:36 mcooper Exp $
  7. #
  8. # Makefile for sysinfo
  9. #
  10.  
  11. #
  12. # Location of your Kernel specific directory.
  13. # This is usually only for SunOS.  If you don't have
  14. # one, set this to nothing
  15. #
  16. KVM        = /usr/kvm
  17.  
  18. #
  19. # The bin directory that user's will run the program from.
  20. # For systems with a $(KVM) (above), a symlink will be put 
  21. # in $(BIN) pointing to ${KVM}/sysinfo.  On systems without 
  22. # a $(KVM), the program will be copied to $(BIN).
  23. #
  24. # A good place is something like /usr/local/bin.
  25. #
  26. BIN         = /usr/local/bin
  27.  
  28. #
  29. # Directory to install man page in.
  30. #
  31. MAN         = /usr/local/man/man1
  32.  
  33. #
  34. # The name of the kvm library to use.
  35. # For SunOS this should be "-lkvm".  For others it should be "kvm.c"
  36. #
  37. LIBKVM        = -lkvm
  38.  
  39. #
  40. # SunOS 4.0 -> 4.0.3 requires using the System V cc and libc
  41. # in order to get uname().
  42. #
  43. #CC        = /usr/5bin/cc
  44. #LIBS         = /usr/5lib/libc.a
  45. #
  46. # The C compiler (gcc) under NeXT 2.1 and earlier is broken.
  47. # You need GCC 2.0 or later.
  48. #
  49. #CC        = gcc
  50.  
  51. #
  52. # Defines.
  53. #
  54. # SunOS needs:
  55. #    -D`/bin/arch -k`
  56. #
  57. DEFINES        = -D`/bin/arch -k`
  58.  
  59. #
  60. # Optimization or debugging flag
  61. #
  62. OPT        = -g
  63.  
  64. #
  65. # Include directories
  66. #
  67. INCLUDES    = -I.
  68.  
  69. CFLAGS         = ${OPT} ${INCLUDES} ${DEFINES}
  70.  
  71. NETIFFILES    = netif.c info-netif.c
  72. MACHFILES    = os-mach.c info-mach.c
  73.  
  74. #
  75. # Select the OS specific files to compile
  76. #
  77. # SunOS
  78. OSFILES        = os-sunos.c info-sunos.c ${NETIFFILES}
  79. # Ultrix
  80. #OSFILES    = os-ultrix.c info-ultrix.c ${NETIFFILES}
  81. # NeXT
  82. #OSFILES    = os-next.c info-next.c ${MACHFILES} ${NETIFFILES}
  83. # Alliant
  84. #OSFILES    = os-alliant.c info-alliant.c
  85. # AIX
  86. #OSFILES    = os-aix.c info-aix.c
  87. # HP300's running 4.3BSD (MORE/bsd)
  88. #OSFILES    = os-bsd43.c info-bsd43.c
  89.  
  90. #
  91. # Misc files
  92. #
  93. # List of files of things your system may not have.
  94. # This may include strcasecmp.c, strdup.c, and strerror.c.
  95. #
  96. MISCFILES    = strdup.c
  97.  
  98. #
  99. # Installation options
  100. #
  101. # Sysinfo needs to be able to read your unix image (/vmunix usually),
  102. # /dev/kmem, and device files in /dev for things like disk drives and tapes.
  103. # Under SunOS, /dev/kmem is owned by group "kmem", but the disk files
  104. # (e.g. /dev/rsd0a) are owned by group "operator".  Therefor, you usually
  105. # can't make setgid to a group, but need it setuid root.
  106. #
  107. # You should set the INSTALLOPTS appropriately to allow sysinfo to read
  108. # everything it needs to.  Try running "sysinfo -debug" to find out the
  109. # special files it reads.
  110. #
  111. INSTALLOPTS     = -m 4555 -o root -g wheel
  112.  
  113. BASE         = sysinfo
  114. PROG         = ${BASE}
  115. SRCS         = ${BASE}.c devices.c memory.c kernel.c run.c KVM.c options.c \
  116.             ${MISCFILES} ${OSFILES}
  117. OBJS        = $(SRCS:%.c=$(VARIANT)%.o)
  118.  
  119. all: ${PROG}
  120.  
  121. ${PROG}: ${OBJS}
  122.     ${CC} ${CFLAGS} -o $@ ${OBJS} ${LIBS} ${LIBKVM}
  123.  
  124. #
  125. # CenterLine support
  126. #
  127. ccenter_src: ${SRCS}
  128.     #load ${CFLAGS} ${SRCS} ${LIBS} ${LIBKVM}
  129.  
  130. ccenter_obj: ${OBJS}
  131.     #load ${CFLAGS} ${OBJS} ${LIBS} ${LIBKVM}
  132.  
  133. install: ${PROG}
  134.     @if [ "${KVM}" ]; then \
  135.         echo "install -c ${INSTALLOPTS} ${PROG} ${KVM}/${BASE}"; \
  136.         install -c ${INSTALLOPTS} ${PROG} ${KVM}/${BASE}; \
  137.         echo "cd ${BIN} && rm -f ${BASE} && ln -s ${KVM}/${BASE} ${BASE}"; \
  138.         (cd ${BIN} && rm -f ${BASE} && ln -s ${KVM}/${BASE} ${BASE}); \
  139.     else \
  140.         echo install -c ${INSTALLOPTS} ${PROG} ${BIN}/${BASE}; \
  141.         install -c ${INSTALLOPTS} ${PROG} ${BIN}/${BASE}; \
  142.     fi
  143.  
  144. install.man: ${BASE}.man
  145.     install -c -m 444 -o bin -g bin ${BASE}.man ${MAN}/${BASE}.1
  146.  
  147. install.compat:
  148.     install -c -m 555 -o bin -g bin cpumodel.sh /usr/lsd/etc/cpumodel
  149.     rm -f $MAN/${BASE}.8 $MAN/cpumodel.1
  150.     (cd /usr/usc/bin; rm -f sysinfo; ln -s ${BIN}/sysinfo)
  151.  
  152. clean:
  153.     rm -f *.o ${PROG} *~ *% \#* core a.out sysinfo.tar sysinfo.tar.Z
  154.  
  155. ${OBJS}: system.h defs.h
  156.