diff options
| author | nima <nima@abc39116-655e-4be6-ad55-d661dc543056> | 2009-03-31 11:42:38 +0000 |
|---|---|---|
| committer | nima <nima@abc39116-655e-4be6-ad55-d661dc543056> | 2009-03-31 11:42:38 +0000 |
| commit | d7200d96d5b90bcd0013c84ec1b053acbcca86c9 (patch) | |
| tree | 76b63b8b927bdbb544fa2de66747baa5cd3da058 /Makefile | |
| parent | 37d1a8117cd212ee9e47bbd4225ba76dece7dad7 (diff) | |
| download | python-dmidecode-d7200d96d5b90bcd0013c84ec1b053acbcca86c9.tar.gz python-dmidecode-d7200d96d5b90bcd0013c84ec1b053acbcca86c9.tar.xz python-dmidecode-d7200d96d5b90bcd0013c84ec1b053acbcca86c9.zip | |
Reverting recent (pointless) change.
git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@180 abc39116-655e-4be6-ad55-d661dc543056
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8e69bb5 --- /dev/null +++ b/Makefile @@ -0,0 +1,97 @@ +#. +#. 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 + +tarball: + rm -rf $(PACKAGE)-$(VERSION) + mkdir $(PACKAGE)-$(VERSION) + cp -r contrib doc examples lib Makefile man README src $(PACKAGE)-$(VERSION) + tar -czvf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION) + +rpm: tarball + rm -rf rpm + mkdir -p rpm/{BUILD,RPMS,SRPMS,SPECS,SOURCES} + cp contrib/$(PACKAGE).spec rpm/SPECS + cp $(PACKAGE)-$(VERSION).tar.gz rpm/SOURCES + rpmbuild -ba --define "_topdir $(shell pwd)/rpm" rpm/SPECS/$(PACKAGE).spec + +############################################################################### +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 |
