1 |
# $Id: Makefile,v 1.3 2002/05/16 15:23:40 tdb Exp $ |
2 |
|
3 |
# defines that should be set |
4 |
DEFS= |
5 |
# libraries that should be set |
6 |
LIBS= |
7 |
|
8 |
# where libukcprog can be found for compiling |
9 |
LIBUKCPROG = libukcprog |
10 |
# where libstatgrab can be found for compiling |
11 |
LIBSTATGRAB = libstatgrab |
12 |
|
13 |
CFLAGS = -O3 -Wall |
14 |
|
15 |
INCLUDES = -I${LIBUKCPROG} -I${LIBSTATGRAB} |
16 |
OURLIBS = ${LIBSTATGRAB}/libstatgrab.a ${LIBUKCPROG}/libukcprog.a |
17 |
|
18 |
all: |
19 |
@echo "Must use one of the following targets :-" |
20 |
@echo " $(MAKE) solaris" |
21 |
@echo " $(MAKE) linux" |
22 |
@echo " $(MAKE) freebsd" |
23 |
@echo " $(MAKE) oldlinux" |
24 |
|
25 |
${LIBUKCPROG}/libukcprog.a: |
26 |
cd ${LIBUKCPROG} && $(MAKE) libukcprog.a |
27 |
|
28 |
${LIBSTATGRAB}/libstatgrab.a: |
29 |
cd ${LIBSTATGRAB} && $(MAKE) libstatgrab.a DEFS="${DEFS}" |
30 |
|
31 |
ihost.o: ihost.c ${LIBUKCPROG}/ukcprog.h ${LIBSTATGRAB}/statgrab.h |
32 |
${CC} ${DEFS} ${CFLAGS} -c ${INCLUDES} ihost.c |
33 |
|
34 |
ihost: ihost.o ${LIBUKCPROG}/libukcprog.a ${LIBSTATGRAB}/libstatgrab.a |
35 |
${CC} ${CFLAGS} -o ihost ihost.o ${OURLIBS} ${LIBS} |
36 |
|
37 |
solaris: |
38 |
$(MAKE) ihost DEFS="-DSOLARIS" LIBS="-lnsl -lsocket -lkstat" |
39 |
|
40 |
linux: |
41 |
$(MAKE) ihost DEFS="-DLINUX" |
42 |
|
43 |
freebsd: |
44 |
$(MAKE) ihost DEFS="-DFREEBSD" LIBS="-lkvm" |
45 |
|
46 |
oldlinux: |
47 |
$(MAKE) ihost DEFS="-DOLDLINUX -DLINUX" |
48 |
|
49 |
clean: |
50 |
rm -f ihost ihost.o |
51 |
cd ${LIBUKCPROG} && $(MAKE) clean |
52 |
cd ${LIBSTATGRAB} && $(MAKE) clean |