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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
include ../Makefile.inc
PACKAGE_D ?= gkrellmd
GKRELLMD_INCLUDES = gkrellmd.h
PKG_INCLUDE = `$(PKG_CONFIG) --cflags glib-2.0 gthread-2.0`
PKG_LIB = `$(PKG_CONFIG) --libs glib-2.0 gmodule-2.0 gthread-2.0`
GLIB12_INCLUDE = `glib-config --cflags`
GLIB12_LIB = `glib-config --libs glib gmodule`
USE_GLIB12?= no
ifeq ($(glib12),1)
USE_GLIB12= yes
endif
ifeq ($(glib12),yes)
USE_GLIB12= yes
endif
CFLAGS?= -O2
FLAGS = -I.. $(PKG_INCLUDE) $(GTOP_INCLUDE)
ifeq ($(USE_GLIB12),yes)
FLAGS = -I.. $(GLIB12_INCLUDE) $(GTOP_INCLUDE)
endif
FLAGS+= $(PTHREAD_INC)
LIBS = $(PKG_LIB) $(GTOP_LIBS_D) $(SYS_LIBS)
ifeq ($(USE_GLIB12),yes)
LIBS = $(GLIB12_LIB) $(GTOP_LIBS_D) $(SYS_LIBS)
endif
ifeq ($(DEBUG),yes)
FLAGS += -g
endif
ifeq ($(PROFILE),yes)
FLAGS += -g -pg
endif
ifeq ($(ENABLE_NLS),1)
FLAGS += -DENABLE_NLS -DLOCALEDIR=\"$(LOCALEDIR)\"
endif
ifneq ($(PACKAGE_D),gkrellmd)
FLAGS += -DPACKAGE_D=\"$(PACKAGE_D)\"
endif
ifeq ($(HAVE_GETADDRINFO),1)
FLAGS += -DHAVE_GETADDRINFO
endif
USE_LIBSENSORS?= yes
ifeq ($(without-libsensors),yes)
USE_LIBSENSORS= no
endif
ifeq ($(without-libsensors),1)
USE_LIBSENSORS= no
endif
ifeq ($(USE_LIBSENSORS),no)
CONFIGURE_ARGS+= --without-libsensors
endif
GREP?= grep
DUMMY_VAR:= $(shell ./configure $(CONFIGURE_ARGS))
HAVE_LIBSENSORS= $(shell $(GREP) -c HAVE_LIBSENSORS configure.h)
ifeq ($(HAVE_LIBSENSORS),1)
SENSORS_LIBS?= -lsensors
LIBS+= $(SENSORS_LIBS)
endif
override CFLAGS += -Wall $(FLAGS)
OBJS = main.o monitor.o mail.o plugins.o glib.o utils.o sysdeps-unix.o
all: build
build: gkrellmd
gkrellmd static: $(OBJS)
$(CC) $(OBJS) -o gkrellmd$(if $(findstring static,$@),.static -static) $(LIBS) $(LINK_FLAGS)
install:
$(INSTALL_DIR) $(SINSTALLDIR)
$(INSTALL_BIN) $(STRIP) gkrellmd $(SINSTALLDIR)/$(PACKAGE_D)
$(INSTALL_DIR) $(SMANDIR)
$(INSTALL_DATA) ../gkrellmd.1 $(SMANDIR)/$(PACKAGE_D).1
$(INSTALL_DIR) $(INCLUDEDIR)/gkrellm2
$(INSTALL_DATA) $(GKRELLMD_INCLUDES) $(INCLUDEDIR)/gkrellm2
uninstall:
rm -f $(SINSTALLDIR)/$(PACKAGE_D)
rm -f $(SMANDIR)/$(PACKAGE_D).1
clean:
rm -f *.o *~ *.bak configure.h configure.log gkrellmd core
SYSDEPS = ../src/sysdeps/bsd-common.c ../src/sysdeps/bsd-net-open.c \
../src/sysdeps/freebsd.c ../src/sysdeps/gtop.c \
../src/sysdeps/linux.c ../src/sysdeps/netbsd.c ../src/sysdeps/dragonfly.c \
../src/sysdeps/openbsd.c ../src/sysdeps/solaris.c ../src/sysdeps/darwin.c
main.o: main.c gkrellmd.h
monitor.o: monitor.c gkrellmd.h
mail.o: mail.c gkrellmd.h
plugins.o: plugins.c gkrellmd.h
glib.o: glib.c gkrellmd.h
utils.o: utils.c gkrellmd.h
sysdeps-unix.o: sysdeps-unix.c gkrellmd.h ../src/gkrellm-sysdeps.h $(SYSDEPS)
|