This repository has been archived by the owner on Jun 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile.Solaris
74 lines (51 loc) · 1.54 KB
/
Makefile.Solaris
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
# Makefile.Solaris - for nicstat, Solaris platform Edition
FILES = nicstat
SOURCES = nicstat.c
BINARY = nicstat
BINARIES = $(BINARY)
COPT = -g -xO3
#COPT = -g
# _REENTRANT gets us the declaration of strtok_r() on Solaris 9
CFLAGS = $(COPT) -D_REENTRANT `./dladm.sh def`
LDLIBS = -lsocket -lkstat -lrt `./dladm.sh lib`
FILES = nicstat
SOURCES = nicstat.c
SU = pfexec
INSTALL = $(SU) /usr/sbin/install -u root -g bin
SETUINSTALL = $(INSTALL)
#--------------------------------
FILES = nicstat
SOURCES = nicstat.c
BASEDIR = /usr/local
BINDIR = $(BASEDIR)/bin
MANDIR = $(BASEDIR)/share/man
MP_DIR = $(BINDIR)
BINARY = nicstat
NATIVE_BINARY = `./nicstat.sh --bin-name`
all : $(FILES)
mv $? $(NATIVE_BINARY)
$(NATIVE_BINARY) : $(BINARY)
mv $? $@
#-- Choose one of these two install methods:
install : install_native install_man
#install : install_multi_platform install_man
install_native : $(BINARIES)
$(INSTALL) $(NATIVE_BINARY) $(BINDIR)/$(BINARY)
# $(INSTALL) -m 555 enicstat $(BINDIR)
#
# You may need to tweak the chown/chmod commands - all Linux
# binaries need setuid-root if they are to use the SIOCETHTOOL ioctl
# (which is optional, see the man page)
#
install_multi_platform : $(NATIVE_BINARY) enicstat
$(INSTALL) -m 755 nicstat.sh $(BINDIR)/nicstat
$(INSTALL) -m 555 enicstat $(BINDIR)
sudo cp -p .nicstat.* $(MP_DIR)
sudo chown root:bin $(MP_DIR)/.nicstat.Linux*
sudo chmod 4711 $(MP_DIR)/.nicstat.Linux*
install_man: nicstat.1
$(INSTALL) -m 444 nicstat.1 $(MANDIR)/man1/nicstat.1
lint :
lint $(SOURCES) $(LDLIBS)
clean :
rm -f $(FILES)