-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
executable file
·78 lines (61 loc) · 1.93 KB
/
Makefile
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
####### Makefile for openwattson - manually generated
#
# All user parameters are stored in a config file
# Default locations are
# 1. Path to config file including filename given as parameter
# 2. ./openwattson.conf
# 3. /usr/local/etc/openwattson.conf
# 4. /etc/openwattson.conf
#
# This makefile is made for Linux.
# No Windows version yet
#
# You may want to adjust the 3 directories below
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
#########################################
CC = gcc
OBJ = linuxwattson.o rwwattson.o
FETCH_OBJ = fetchwattson.o $(OBJ)
LOG_OBJ = logwattson.o $(OBJ)
GET_POWER_OBJ = getpower.o $(OBJ)
GET_GEN_OBJ = getgen.o $(OBJ)
VERSION = 0.1
HTML_DIR = ../html_openwattson
CFLAGS = -Wall -O3 -DVERSION=\"$(VERSION)\"
CC_LDFLAGS = -lm
CC_WINFLAG =
# For Windows - comment the two line above and un-comment the two lines below.
#CC_LDFLAGS = -lm -lwsock32
#CC_WINFLAG = -mwindows
INSTALL = install
####### Build rules
all: fetchwattson logwattson getpower getgen
fetchwattson : $(FETCH_OBJ)
$(CC) $(CFLAGS) -o $@ $(FETCH_OBJ) $(CC_LDFLAGS)
logwattson : $(LOG_OBJ)
$(CC) $(CFLAGS) -o $@ $(LOG_OBJ) $(CC_LDFLAGS)
getpower : $(GET_POWER_OBJ)
$(CC) $(CFLAGS) -o $@ $(GET_POWER_OBJ) $(CC_LDFLAGS)
getgen : $(GET_GEN_OBJ)
$(CC) $(CFLAGS) -o $@ $(GET_GEN_OBJ) $(CC_LDFLAGS)
install:
mkdir -p $(bindir)
$(INSTALL) fetchwattson $(bindir)
$(INSTALL) logwattson $(bindir)
$(INSTALL) getpower $(bindir)
$(INSTALL) getgen $(bindir)
uninstall:
rm -f $(bindir)/fetchwattson $(bindir)/logwattson $(bindir)/getpower $(binddir)/getgen
clean:
rm -rf *~ *.o fetchwattson logwattson getpower getgen
cleanexe:
rm -f *~ *.o fetchwattson.exe logwattson.exe getpower.exe getgen.exe
tarball: clean
mkdir -p $(HTML_DIR)
tar -cf $(HTML_DIR)/openwattson-$(VERSION).tar ../openwattson
gzip -9 $(HTML_DIR)/openwattson-$(VERSION).tar
cp -u README $(HTML_DIR)/
cp -u INSTALL $(HTML_DIR)/
cp -u COPYING $(HTML_DIR)/