home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume26 / sysinfo-1.0 / part01 / Mkfile.cpp < prev    next >
C/C++ Source or Header  |  1993-04-10  |  3KB  |  132 lines

  1. #
  2. # $Header: /src/common/usc/bin/sysinfo/RCS/Mkfile.cpp,v 1.24 1992/06/01 22:38:55 mcooper Exp $
  3. #
  4.  
  5. #define USE_KARCH
  6. #include "/usr/usc/include/mk/all.h"
  7.  
  8. KVM        = /usr/kvm/lsd
  9. BIN         = /usr/lsd/bin
  10. MAN         = /usr/usc/man/man1
  11.  
  12. #if defined(sun)
  13. LIBKVM        = -lkvm
  14. #else
  15. LIBKVM        =
  16. #endif
  17.  
  18. #if defined(sun) && defined(OSVERSION) && OSVERSION == 40
  19. CC        = /usr/5bin/cc
  20. LIBS         = /usr/5lib/libc.a -L/usr/usc/lib -lgen $LIBKVM
  21. #else
  22. LIBS         = -L/usr/usc/lib -lgen $LIBKVM
  23. #endif
  24. #if defined(alliant)
  25. CC        = cc
  26. LIBS         = /usr/usc/lib/libgen.a -lcommon $LIBKVM
  27. #endif
  28. #if defined(NeXT)
  29. CC        = gcc
  30. #endif
  31.  
  32. NETIFOBJS    = ${O}netif.o ${O}info-netif.o
  33. MACHOBJS    = ${O}os-"mach".o ${O}info-"mach".o
  34. #ifdef sun
  35. OSFILES        = ${O}os-"sunos".o ${O}info-"sunos".o $NETIFOBJS
  36. OSDEFS        = -D`/bin/arch -k`
  37. #endif
  38. #ifdef ultrix
  39. OSFILES        = ${O}os-"ultrix".o ${O}info-"ultrix".o $NETIFOBJS
  40. #endif
  41. #ifdef NeXT
  42. OSFILES        = ${O}os-"next".o ${O}info-"next".o $MACHOBJS $NETIFOBJS
  43. #endif
  44. #ifdef alliant
  45. OSFILES        = ${O}os-"alliant.o" ${O}info-"alliant".o
  46. #endif
  47. #ifdef _AIX
  48. OSFILES        = ${O}os-"aix.o" ${O}info-"aix".o
  49. #endif
  50. /* Should use something besides hp300 */
  51. #ifdef hp300
  52. OSFILES        = ${O}os-"bsd43.o" ${O}info-"bsd43".o
  53. #endif
  54.  
  55. OPT        = -g
  56. #ifdef sun
  57. INCLUDES    = -I/usr/usc/include
  58. #else
  59. INCLUDES    = -I/usr/usc/include -I.
  60. #endif
  61. DEFINES        = -DOPTION_COMPAT $OSDEFS
  62. CFLAGS         = $OPT $INCLUDES $DEFINES
  63.  
  64.  
  65. NPROC         = 4
  66. BASE         = sysinfo
  67. PROG         = ${O}sysinfo
  68. OBJS         = ${O}sysinfo.o ${O}devices.o ${O}memory.o ${O}kernel.o \
  69.             ${O}run.o ${O}KVM.o ${O}kvm.o ${O}strdup.o $OSFILES
  70. SRCS        = "`echo $OBJS | sed -e "s;$O;;g" -e 's;\.o;.c;g'`"
  71. ALLSRCS        = sysinfo.c devices.c memory.c kernel.c\
  72.             run.c KVM.c kvm.c kvm.h patchlevel.h \
  73.             strcasecmp.c strdup.c strerror.c \
  74.             options.c options.h \
  75.             system.h defs.h \
  76.             netif.c info-netif.c \
  77.             os-mach.c info-mach.c \
  78.             os-sunos.c info-sunos.c \
  79.             os-ultrix.c info-ultrix.c info-ultrix.h \
  80.             os-next.c info-next.c \
  81.             os-alliant.c info-alliant.c \
  82.             os-bsd43.c info-bsd43.c \
  83.             os-aix.c info-aix.c
  84.  
  85. all: $PROG
  86.  
  87. $PROG: $OBJS $LIBS
  88.     $CC $CFLAGS -o ${target} $OBJS $LIBS
  89.  
  90. #if    defined(sun)
  91. install: ${PROG}
  92.     install -c -m 4555 -o root -g wheel $PROG $KVM/$BASE
  93.     (cd $BIN && rm -f $BASE && ln -s $KVM/$BASE $BASE)
  94. #else
  95. install: ${PROG}
  96.     install -c -m 4555 -o root -g wheel $PROG $BIN/$BASE
  97. #endif    /* sun */
  98.  
  99. install.man: ${BASE}.man
  100.     install -c -m 444 -o bin -g bin ${BASE}.man $MAN/$BASE.1
  101.  
  102. install.compat:
  103.     install -c -m 555 -o bin -g bin cpumodel.sh /usr/lsd/etc/cpumodel
  104.     rm -f $MAN/${BASE}.8 $MAN/cpumodel.1
  105.     (cd /usr/usc/bin; rm -f sysinfo; ln -s ${BIN}/sysinfo)
  106.  
  107. #
  108. # Centerline stuff
  109. #
  110. #ifdef sun /* Some platforms don't like the #load below */
  111. cc_src:
  112.     #load $CFLAGS $SRCS $LIBS $LIBKVM
  113.  
  114. cc_obj:
  115.     #load $CFLAGS $OBJS $LIBS $LIBKVM
  116. #endif
  117.  
  118. clean:
  119.     rm -f ${PROG} *~ *% \#* core a.out ${O}*.o
  120.  
  121. $OBJS: system.h defs.h
  122.  
  123. DISTFILES = README sysinfo.man Makefile $ALLSRCS options.3 Mkfile.cpp
  124.  
  125. sysinfo.tar: $DISTFILES
  126.     rm -f $target
  127.     tar chf $target $DISTFILES
  128.  
  129. sysinfo.shar: $DISTFILES
  130.     rm -f $target
  131.     shar $DISTFILES > $target
  132.