aboutsummaryrefslogtreecommitdiff
path: root/sysutils/gkrellm2/files/patch-server::Makefile
blob: b36c836878f985c8bfc807302c8e22431cb68eb5 (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
83
84
85
86
87
88
89
90
91
Index: server/Makefile
diff -u server/Makefile.orig server/Makefile
--- server/Makefile.orig	Wed Oct 25 08:41:53 2006
+++ server/Makefile	Fri Oct 27 12:39:38 2006
@@ -18,6 +18,7 @@
 MANMODE ?= 644
 MANDIRMODE ?= 755
 INSTALL ?= install
+PKGCONFIGDIR ?= $(INSTALLROOT)/lib/pkgconfig
 LINK_FLAGS ?= -Wl,-E
 
 
@@ -44,18 +45,18 @@
 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`
+GLIB12_INCLUDE = `$(GLIB_CONFIG) --cflags`
+GLIB12_LIB = `$(GLIB_CONFIG) --libs glib gmodule`
 
-FLAGS = -O2 -I.. $(PKG_INCLUDE) $(GTOP_INCLUDE)
+FLAGS = -I.. $(PKG_INCLUDE) $(GTOP_INCLUDE)
 ifeq ($(glib12),1)
-FLAGS = -O2 -I.. $(GLIB12_INCLUDE) $(GTOP_INCLUDE)
+FLAGS = -I.. $(GLIB12_INCLUDE) $(GTOP_INCLUDE)
 endif
 ifeq ($(glib12),yes)
-FLAGS = -O2 -I.. $(GLIB12_INCLUDE) $(GTOP_INCLUDE)
+FLAGS = -I.. $(GLIB12_INCLUDE) $(GTOP_INCLUDE)
 endif
 
-FLAGS+= $(PTHREAD_INC)
+FLAGS+= $(PTHREAD_INC) -I$(LOCALBASE)/include
 
 LIBS = $(PKG_LIB) $(GTOP_LIBS_D) $(SYS_LIBS) $(SENSORS_LIBS)
 
@@ -105,10 +106,18 @@
 
 all:	gkrellmd
 
-gkrellmd: $(OBJS)
+gkrellmd.pc: Makefile
+	echo "prefix=$(INSTALLROOT)" > gkrellmd.pc
+	echo "Name: GKrellMd" >> gkrellmd.pc
+	echo "Description: Extensible GLIB system monitoring application server" >> gkrellmd.pc
+	echo "Version: $(VERSION)" >> gkrellmd.pc
+	echo "Requires: glib-2.0" >> gkrellmd.pc
+	echo "Cflags: -I$(INCLUDEDIR)" >> gkrellmd.pc
+
+gkrellmd: gkrellmd.pc $(OBJS)
 	$(CC) $(OBJS) -o gkrellmd $(LIBS) $(LINK_FLAGS)
 
-static: $(OBJS)
+static: gkrellmd.pc $(OBJS)
 	$(CC) $(OBJS) -o gkrellmd.static -static \
 		$(LIBS) $(LINK_FLAGS)
 
@@ -145,17 +154,22 @@
 		LINK_FLAGS="" gkrellmd
 endif
 
-install:
+install: install_gkrellmd.pc
 	$(INSTALL) -d -m $(INSTALLDIRMODE) $(SINSTALLDIR)
 	$(INSTALL) -c $(STRIP) -m $(BINMODE) gkrellmd $(SINSTALLDIR)/$(PACKAGE_D)
 	$(INSTALL) -d -m $(INCLUDEDIRMODE) $(INCLUDEDIR)/gkrellm2
 	$(INSTALL) -c -m $(INCLUDEMODE) $(GKRELLMD_INCLUDES) $(INCLUDEDIR)/gkrellm2
 	$(INSTALL) -d -m $(MANDIRMODE) $(SMANDIR)
-	$(INSTALL) -c -m $(MANMODE) ../gkrellmd.1 $(SMANDIR)/$(PACKAGE_D).1
+	$(INSTALL) -c -m $(MANMODE) ../gkrellmd.1 $(SMANDIR)/$(PACKAGE_D).8
 
 uninstall:
 	rm -f $(SINSTALLDIR)/$(PACKAGE_D)
 	rm -f $(SMANDIR)/$(PACKAGE_D).1
+	rm -f $(PKGCONFIGDIR)/gkrellmd.pc
+
+install_gkrellmd.pc:
+	$(INSTALL) -d $(PKGCONFIGDIR)
+	$(INSTALL) -c -m $(INCLUDEMODE) gkrellmd.pc $(PKGCONFIGDIR)
 
 install_darwin:
 	$(MAKE) install STRIP=
@@ -180,6 +194,7 @@
 
 clean:
 	rm -f *.o *~ *.bak configure.h configure.log gkrellmd core
+	rm -f gkrellmd.pc
 
 SYSDEPS = ../src/sysdeps/bsd-common.c ../src/sysdeps/bsd-net-open.c \
 	../src/sysdeps/freebsd.c ../src/sysdeps/gtop.c \