File: Makefile

package info (click to toggle)
gkrellweather 2.0.8-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 252 kB
  • sloc: ansic: 881; perl: 92; makefile: 78
file content (57 lines) | stat: -rw-r--r-- 1,719 bytes parent folder | download
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
PKGNAME = gkrellweather
VERSION = 2.0.8
PKG_CONFIG ?= pkg-config
CFLAGS += -O2 -std=gnu99 -Wall -fPIC `$(PKG_CONFIG) gtk+-2.0 --cflags`
LIBS = `$(PKG_CONFIG) gtk+-2.0 --libs`
LDFLAGS += -shared
PREFIX = /usr

LOCALEDIR := $(PREFIX)/share/locale

ifeq ($(enable_nls),1)
    CFLAGS += -DENABLE_NLS -DLOCALEDIR=\"$(LOCALEDIR)\"
    export enable_nls
endif
CFLAGS += -DPACKAGE="\"$(PKGNAME)\""
export PKGNAME LOCALEDIR

CC = gcc

OBJS = gkrellweather.o

gkrellweather.so: $(OBJS)
	(cd po && ${MAKE} all )
	$(CC) $(LDFLAGS) $(OBJS) -DVERSION=\"$(VERSION)\" -o gkrellweather.so $(LIBS) -lpthread

clean:
	(cd po && ${MAKE} clean )
	rm -f *.o core *.so* *.bak *~

gkrellweather.o: gkrellweather.c
	$(CC) $(CFLAGS) -DPREFIX=\"$(PREFIX)\" -DVERSION=\"$(VERSION)\" -c gkrellweather.c

install:
	(cd po && ${MAKE} install )
	if [ -d /usr/lib/gkrellm2/plugins/ ] ; then \
		install -c -m 644 gkrellweather.so /usr/lib/gkrellm2/plugins/ ; \
	elif [ -d $(PREFIX)/lib/gkrellm2/plugins/ ] ; then \
		install -c -m 644 gkrellweather.so $(PREFIX)/lib/gkrellm2/plugins/ ; \
	else \
		install -D -c -m 644 gkrellweather.so $(PREFIX)/lib/gkrellm2/plugins/gkrellweather.so ; \
	fi
	install -c -m 755 GrabWeather $(PREFIX)/bin

uninstall:
	(cd po && ${MAKE} uninstall )
	rm -f /usr/lib/gkrellm2/plugins/gkrellweather.so
	rm -f $(PREFIX)/lib/gkrellm2/plugins/gkrellweather.so
	rm -f $(PREFIX)/bin/GrabWeather

dist:
	rm -rf $(PKGNAME)-$(VERSION)
	mkdir $(PKGNAME)-$(VERSION)
	cp COPYING ChangeLog Makefile README gkrellweather.c GrabWeather $(PKGNAME)-$(VERSION)/
	mkdir $(PKGNAME)-$(VERSION)/po
	cp po/*.po po/Makefile po/README $(PKGNAME)-$(VERSION)/po/
	tar zcf $(PKGNAME)-$(VERSION).tgz $(PKGNAME)-$(VERSION)
	rm -rf $(PKGNAME)-$(VERSION)