Codebase list distro-info / debian/0.11 Makefile
debian/0.11

Tree @debian/0.11 (Download .tar.gz)

Makefile @debian/0.11

1807c7b
 
 
 
 
 
 
73ce379
 
 
8a96d9a
73ce379
1807c7b
169fea0
1807c7b
c4f8e5d
73ce379
169fea0
 
 
 
 
522880e
 
 
 
 
1807c7b
 
af73f42
 
444e6e8
c12a896
1807c7b
32d873d
9709c46
32d873d
522880e
 
9709c46
 
17d8170
9709c46
 
ce5962d
1807c7b
 
522880e
1807c7b
 
32d873d
define \n


endef

PREFIX ?= /usr
VENDOR ?= $(shell dpkg-vendor --query Vendor | tr '[:upper:]' '[:lower:]')

CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
CFLAGS += -Wall -Wextra -g -O2 -std=gnu99
LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)

build: debian-distro-info ubuntu-distro-info

%-distro-info: %-distro-info.c distro-info-util.*
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $<

install: debian-distro-info ubuntu-distro-info
	install -d $(DESTDIR)$(PREFIX)/bin
	install -m 755 $^ $(DESTDIR)$(PREFIX)/bin
	ln -s $(VENDOR)-distro-info $(DESTDIR)$(PREFIX)/bin/distro-info
	install -d $(DESTDIR)$(PREFIX)/share/distro-info
	install -m 644 shunit2-helper-functions.sh $(DESTDIR)$(PREFIX)/share/distro-info
	$(foreach distro,debian ubuntu,sed -e 's@^\(COMMAND=\"\).*/\(.*-distro-info\"\)$$@\1\2@' \
	    test-$(distro)-distro-info > $(DESTDIR)$(PREFIX)/share/distro-info/test-$(distro)-distro-info$(\n) \
	    chmod 755 $(DESTDIR)$(PREFIX)/share/distro-info/test-$(distro)-distro-info$(\n))
	install -d $(DESTDIR)$(PREFIX)/share/man/man1
	install -m 644 $(wildcard doc/*.1) $(DESTDIR)$(PREFIX)/share/man/man1
	install -d $(DESTDIR)$(PREFIX)/share/perl5/Debian
	install -m 644 $(wildcard perl/Debian/*.pm) $(DESTDIR)$(PREFIX)/share/perl5/Debian
	cd python && python setup.py install --root="$(DESTDIR)" --no-compile --install-layout=deb
	cd python && python3 setup.py install --root="$(DESTDIR)" --no-compile --install-layout=deb

test: test-commandline test-perl test-python

test-commandline: debian-distro-info ubuntu-distro-info
	./test-debian-distro-info
	./test-ubuntu-distro-info

test-perl:
	cd perl && ./test.pl

test-python:
	$(foreach python,$(shell pyversions -r && py3versions -r),cd python && $(python) setup.py test$(\n))

clean:
	rm -rf debian-distro-info ubuntu-distro-info python/build python/*.egg-info
	find python -name '*.pyc' -delete

.PHONY: build clean install test test-commandline test-perl test-python