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