blob: a85a2ee10e27e905340712168b4dab2ae4d21ca2 (
plain)
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
111
112
|
#.
#. DMI Decode Python Extension Module
#.
#. (C) 2008 Nima Talebi <nima@it.net.au>
#.
#. Licensed under the GNU Public License v3
#.
VERSION := 2.10
PY := $(shell python -V 2>&1 |sed -e 's/.\(ython\) \(2\.[0-9]\)\..*/p\1\2/')
PY_VER := $(subst python,,$(PY))
PACKAGE := python-dmidecode
SRCSRV := /var/www/nima/sites/src.autonomy.net.au/pub
CC := gcc
RM := rm -f
SRC_D := src
OBJ_D := lib
CFLAGS = -g -D_XOPEN_SOURCE=600
CFLAGS += -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align
CFLAGS += -Wwrite-strings -Wmissing-prototypes -Winline -Wundef #-Wcast-qual
CFLAGS += -pthread -fno-strict-aliasing -DNDEBUG -fPIC
CFLAGS += -I/usr/include/$(PY)
CFLAGS += -O3
#CFLAGS += -DNDEBUG
#CFLAGS += -DBIGENDIAN
#CFLAGS += -DALIGNMENT_WORKAROUND
#LDFLAGS = -lefence
LDFLAGS =
SOFLAGS = -pthread -shared -L/home/nima/dev-room/projects/dmidecode -lutil
SO = build/lib.linux-$(shell uname -m)-$(PY_VER)/dmidecode.so
#. Search
vpath %.o $(OBJ_D)
vpath %.c $(SRC_D)
vpath %.h $(SRC_D)
vpath % $(OBJ_D)
###############################################################################
build: $(PY)-dmidecode.so
$(PY)-dmidecode.so: $(SO)
cp $< $@
build: $(SO)
$(SO):
$(PY) src/setup.py build
install:
$(PY) src/setup.py install
uninstall:
$(PY) src/setup.py uninstall
clean :
dh_clean
$(PY) src/setup.py clean
-$(RM) *.so lib/*.o core
-rm -rf build .dpkg
###############################################################################
#. Debian
all: source binary
source: debian orig.tar.gz
cp ../tarballs/$(PACKAGE)_$(VERSION).orig.tar.gz ../$(PACKAGE)_$(VERSION).orig.tar.gz
debuild -S -sa -i
mv ../$(PACKAGE)_$(VERSION)* ../sources
lintian --verbose -iI ../sources/$(PACKAGE)_$(VERSION)-1_source.changes
scp ../sources/$(PACKAGE)_$(VERSION).orig.tar.gz nima@src.autonomy.net.au:/var/www/nima/sites/src.autonomy.net.au/pub/$(PACKAGE)/
orig.tar.gz: ../tarballs/$(PACKAGE)_$(VERSION).orig.tar.gz
../tarballs/$(PACKAGE)_$(VERSION).orig.tar.gz: clean .
cd .. && tar czvf tarballs/$(PACKAGE)_$(VERSION).orig.tar.gz \
--exclude "*.svn" \
--exclude debian \
--exclude redhat \
--exclude private \
$(PACKAGE)-$(VERSION)
touch $@
binary: debian orig.tar.gz
-rm ../build-area/$(PACKAGE)_$(VERSION)*
svn-buildpackage --svn-ignore-new -us -uc -rfakeroot -enima@it.net.au
lintian --verbose -c ../build-area/$(PACKAGE)_$(VERSION)-1_i386.deb
lintian --verbose -iI ../build-area/$(PACKAGE)_$(VERSION)-1_i386.changes
dupload: debian source
cd ../sources && dupload -t mentors $(PACKAGE)_$(VERSION)-1_source.changes
###############################################################################
libdmidecode.so: dmihelper.o util.o dmioem.o dmidecode.o dmidecodemodule.o
$(CC) $(LDFLAGS) $(SOFLAGS) $^ -o $@
$(OBJ_D)/dmidecodemodule.o: dmidecodemodule.c
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJ_D)/dmidecode.o: dmidecode.c version.h types.h util.h config.h dmidecode.h dmioem.h
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJ_D)/dmihelper.o: dmihelper.c dmihelper.h
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJ_D)/util.o: util.c types.h util.h config.h
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJ_D)/dmioem.o: dmioem.c types.h dmidecode.h dmioem.h
$(CC) $(CFLAGS) -c -o $@ $<
###############################################################################
.PHONY: install clean uninstall build dupload
.PHONY: srcsrv binary source orig.tar.gz all
|