home *** CD-ROM | disk | FTP | other *** search
Makefile | 1993-04-10 | 3.7 KB | 156 lines |
- #
- # Copyright (c) 1992 Michael A. Cooper.
- # This software may be freely distributed provided it is not sold for
- # profit and the author is credited appropriately.
- #
- # $Header: /src/common/usc/bin/sysinfo/RCS/Makefile,v 1.8 1992/04/26 23:31:36 mcooper Exp $
- #
- # Makefile for sysinfo
- #
-
- #
- # Location of your Kernel specific directory.
- # This is usually only for SunOS. If you don't have
- # one, set this to nothing
- #
- KVM = /usr/kvm
-
- #
- # The bin directory that user's will run the program from.
- # For systems with a $(KVM) (above), a symlink will be put
- # in $(BIN) pointing to ${KVM}/sysinfo. On systems without
- # a $(KVM), the program will be copied to $(BIN).
- #
- # A good place is something like /usr/local/bin.
- #
- BIN = /usr/local/bin
-
- #
- # Directory to install man page in.
- #
- MAN = /usr/local/man/man1
-
- #
- # The name of the kvm library to use.
- # For SunOS this should be "-lkvm". For others it should be "kvm.c"
- #
- LIBKVM = -lkvm
-
- #
- # SunOS 4.0 -> 4.0.3 requires using the System V cc and libc
- # in order to get uname().
- #
- #CC = /usr/5bin/cc
- #LIBS = /usr/5lib/libc.a
- #
- # The C compiler (gcc) under NeXT 2.1 and earlier is broken.
- # You need GCC 2.0 or later.
- #
- #CC = gcc
-
- #
- # Defines.
- #
- # SunOS needs:
- # -D`/bin/arch -k`
- #
- DEFINES = -D`/bin/arch -k`
-
- #
- # Optimization or debugging flag
- #
- OPT = -g
-
- #
- # Include directories
- #
- INCLUDES = -I.
-
- CFLAGS = ${OPT} ${INCLUDES} ${DEFINES}
-
- NETIFFILES = netif.c info-netif.c
- MACHFILES = os-mach.c info-mach.c
-
- #
- # Select the OS specific files to compile
- #
- # SunOS
- OSFILES = os-sunos.c info-sunos.c ${NETIFFILES}
- # Ultrix
- #OSFILES = os-ultrix.c info-ultrix.c ${NETIFFILES}
- # NeXT
- #OSFILES = os-next.c info-next.c ${MACHFILES} ${NETIFFILES}
- # Alliant
- #OSFILES = os-alliant.c info-alliant.c
- # AIX
- #OSFILES = os-aix.c info-aix.c
- # HP300's running 4.3BSD (MORE/bsd)
- #OSFILES = os-bsd43.c info-bsd43.c
-
- #
- # Misc files
- #
- # List of files of things your system may not have.
- # This may include strcasecmp.c, strdup.c, and strerror.c.
- #
- MISCFILES = strdup.c
-
- #
- # Installation options
- #
- # Sysinfo needs to be able to read your unix image (/vmunix usually),
- # /dev/kmem, and device files in /dev for things like disk drives and tapes.
- # Under SunOS, /dev/kmem is owned by group "kmem", but the disk files
- # (e.g. /dev/rsd0a) are owned by group "operator". Therefor, you usually
- # can't make setgid to a group, but need it setuid root.
- #
- # You should set the INSTALLOPTS appropriately to allow sysinfo to read
- # everything it needs to. Try running "sysinfo -debug" to find out the
- # special files it reads.
- #
- INSTALLOPTS = -m 4555 -o root -g wheel
-
- BASE = sysinfo
- PROG = ${BASE}
- SRCS = ${BASE}.c devices.c memory.c kernel.c run.c KVM.c options.c \
- ${MISCFILES} ${OSFILES}
- OBJS = $(SRCS:%.c=$(VARIANT)%.o)
-
- all: ${PROG}
-
- ${PROG}: ${OBJS}
- ${CC} ${CFLAGS} -o $@ ${OBJS} ${LIBS} ${LIBKVM}
-
- #
- # CenterLine support
- #
- ccenter_src: ${SRCS}
- #load ${CFLAGS} ${SRCS} ${LIBS} ${LIBKVM}
-
- ccenter_obj: ${OBJS}
- #load ${CFLAGS} ${OBJS} ${LIBS} ${LIBKVM}
-
- install: ${PROG}
- @if [ "${KVM}" ]; then \
- echo "install -c ${INSTALLOPTS} ${PROG} ${KVM}/${BASE}"; \
- install -c ${INSTALLOPTS} ${PROG} ${KVM}/${BASE}; \
- echo "cd ${BIN} && rm -f ${BASE} && ln -s ${KVM}/${BASE} ${BASE}"; \
- (cd ${BIN} && rm -f ${BASE} && ln -s ${KVM}/${BASE} ${BASE}); \
- else \
- echo install -c ${INSTALLOPTS} ${PROG} ${BIN}/${BASE}; \
- install -c ${INSTALLOPTS} ${PROG} ${BIN}/${BASE}; \
- fi
-
- install.man: ${BASE}.man
- install -c -m 444 -o bin -g bin ${BASE}.man ${MAN}/${BASE}.1
-
- install.compat:
- install -c -m 555 -o bin -g bin cpumodel.sh /usr/lsd/etc/cpumodel
- rm -f $MAN/${BASE}.8 $MAN/cpumodel.1
- (cd /usr/usc/bin; rm -f sysinfo; ln -s ${BIN}/sysinfo)
-
- clean:
- rm -f *.o ${PROG} *~ *% \#* core a.out sysinfo.tar sysinfo.tar.Z
-
- ${OBJS}: system.h defs.h
-