-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGNUmakefile
66 lines (55 loc) · 2 KB
/
GNUmakefile
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
###########################################################################
#
# This program is part of Zenoss Core, an open source monitoring platform.
# Copyright (C) 2008-2010, Zenoss Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2, or (at your
# option) any later version, as published by the Free Software Foundation.
#
# For complete information please visit: http://www.zenoss.com/oss/
#
###########################################################################
CPP=gcc -E -ffreestanding
all: install
install: pywmi-installed
build: pywmi-build
ifeq ($(PYTHON),)
PYTHON=python
endif
PYLIBDIR= $(ZENHOME)/lib/python
ZENBIN= $(ZENHOME)/bin
PYINCLUDE= $(shell $(PYTHON) pyinclude.py)
VERSION:=$(shell cd pysamba ; python -c 'import version as v; print v.VERSION')
LIBSUFFIX=so.0
ifeq ($(shell uname), Darwin)
LIBSUFFIX=dylib
endif
pywmi-build:
cd Samba/source ; \
./autogen.sh ; \
CPPFLAGS="-I$(PYINCLUDE)" \
./configure --without-readline --enable-debug ; \
$(MAKE) proto bin/wmic bin/winexe libraries ; \
touch $@
pywmi-installed: $(DESTDIR)$(PYLIBDIR) $(DESTDIR)$(ZENBIN) pywmi-build
cd Samba/source ; \
cp bin/winexe $(DESTDIR)$(ZENBIN) ; \
cp bin/wmic $(DESTDIR)$(ZENBIN) ; \
cp bin/shared/*async_wmi_lib.$(LIBSUFFIX)* $(DESTDIR)$(PYLIBDIR)
rm -rf $(DESTDIR)$(PYLIBDIR)/pysamba
cp -r pysamba $(DESTDIR)$(PYLIBDIR)
$(DESTDIR)$(ZENBIN) $(DESTDIR)$(PYLIBDIR):
mkdir -p $@
clean:
-cd Samba/source && make distclean
rm -f Samba/source/bin/shared/*
rm -f Samba/source/bin/static/*
rm -f Samba/source/heimdal/lib/des/hcrypto
tarball:
-svn rm -m 'cleanup' http://dev.zenoss.org/svn/tags/wmi-$(VERSION)
svn cp -m "tagging wmi-$(VERSION)" http://dev.zenoss.org/svn/trunk/wmi http://dev.zenoss.org/svn/tags/wmi-$(VERSION)
svn export http://dev.zenoss.org/svn/tags/wmi-$(VERSION)
tar -cjf ../wmi-$(VERSION).tar.bz2 wmi-$(VERSION)
rm -rf wmi-$(VERSION)
.PHONY: tarball clean pywmi-installed pywmi-build