aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/mbmon/files/patch-aa
blob: 58babcd1f9cd36632e110c72e995ac019da5531f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
--- Makefile.in.orig    Sat May  1 22:20:14 2004
+++ Makefile.in Mon May 24 22:14:19 2004
@@ -18,9 +18,9 @@
 
 DEFS=-DHAVE_CONFIG_H -Wall @HOSTDEF@
 
-LIBDIR=/usr/X11R6/lib
+LIBDIR=$(X11BASE)/lib
 INCDIR=.
-XINCDIR=/usr/X11R6/include
+XINCDIR=$(X11BASE)/include
 XLIB=-lXaw -lXmu
 EXTENSIONLIB=-lXext
 INCLUDES=-I$(INCDIR)
@@ -29,9 +29,9 @@
 LIBS=-L$(LIBDIR) -lXaw $(XLIB) -lXt $(EXTENSIONLIB) -lX11 -lm
 
 #CC=/compat/linux/usr/bin/gcc
-CC=@CC@
-CFLAGS=-O3 $(INCLUDES) $(DEFS)
-CFLAGSX=-O3 $(XINCLUDES) $(DEFS)
+CC?=@CC@
+CFLAGS+= $(INCLUDES) $(DEFS)
+CFLAGSX= $(XINCLUDES) $(DEFS)
 LDFLAGS=-s
 
 LINT=lint
@@ -40,19 +40,25 @@
 RM=rm -f
 INSTALL=install
 
-INST_DIR=/usr/local/bin
-INST_MANDIR=/usr/local/man/man1
-INST_XDIR=/usr/X11R6/bin
-INST_MANXDIR=/usr/X11R6/man/man1
-INST_XRDIR=/usr/X11R6/lib/X11/app-defaults
+INST_DIR=$(PREFIX)/bin
+INST_MANDIR=$(PREFIX)/man/man1
+INST_XDIR=$(X11BASE)/bin
+INST_MANXDIR=$(X11BASE)/man/man1
+INST_XRDIR=$(X11BASE)/lib/X11/app-defaults
  
 .c.o:
    $(CC) -c $(CFLAGS) $*.c
 
 MANPAGE = mbmon.1 xmbmon.1x
-PROGRAM = mbmon xmbmon
-
+PROGRAM = mbmon
 TESTPROG = testpci testsmb testhwm testfan
+DOCS= ReadMe ReadMe.jp ReadMe.tech
+.if !defined(WITHOUT_X11)
+DOCS+= xmbmon.resources
+PROGRAM+= xmbmon
+.endif
+
+all: $(PROGRAM) $(TESTPROG)
 
 MB_OBJ  = getMB-via.o getMB-smb.o getMB-isa.o
 SMB_OBJ = smbuses.o smbus_piix4.o smbus_amd.o smbus_ali.o smbus_amd8.o
@@ -136,12 +142,18 @@
    $(RM) Makefile config.cache config.log config.h config.status
 
 install: $(PROGRAM)
-   $(INSTALL) -o root -g wheel -m 4555 -c -p mbmon $(INST_DIR)
-   $(INSTALL) -o root -g wheel -m 4555 -c -p xmbmon $(INST_XDIR)
+   @for i in $(PROGRAM); do \
+       $(INSTALL) -o root -g wheel -m 4555 -c -p $$i $(INST_DIR); \
+   done
 
 install-man: $(MANPAGE)
    $(INSTALL) -o root -g wheel -m 444 -c -p mbmon.1 $(INST_MANDIR)
-   $(INSTALL) -o root -g wheel -m 444 -c -p xmbmon.1x $(INST_MANXDIR)
+
+install-doc:
+   @for f in $(DOCS); do \
+       $(INSTALL_DATA) $$f $(DOCSDIR)/; \
+   done
+   $(INSTALL) -o root -g wheel -m 444 -c -p xmbmon.1x $(INST_MANDIR)
 
 lint:
    $(LINT) $(INCLUDES) $(DEFS) $(FONTDEFINES) $(SRCS) -lm