Added dependencies and cleaned up Makefile
This commit is contained in:
36
Makefile
36
Makefile
@@ -8,13 +8,13 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
DEPENDS =
|
||||
DEPENDS = glibc,xz,zlib
|
||||
ARCH = x86_64
|
||||
URL = http://git.kernel.org/cgit/utils/kernel/kmod/kmod.git/about/
|
||||
DESC = kmod is a set of tools to handle common tasks with Linux kernel \
|
||||
modules like insert, remove, list, check properties, resolve dependencies \
|
||||
and aliases.
|
||||
SNAPVER = sr0
|
||||
SNAPVER = sr1
|
||||
|
||||
ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1)
|
||||
TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n')
|
||||
@@ -22,16 +22,6 @@ SRCDIR := $(shell tar -tf $(ARCHIVE)|head -1|sed 's/\/.*//')
|
||||
PATCHDIR := $(PWD)/SRC/patches
|
||||
VERSION := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'|sed 's/^-//')$(SNAPVER)
|
||||
|
||||
MAKE = make
|
||||
MAKEINST = make install
|
||||
SNAPHACKS = install -d -m 755 $(ROOT)/sbin && \
|
||||
ln -sv ../bin/kmod $(ROOT)/sbin/depmod && \
|
||||
ln -sv ../bin/kmod $(ROOT)/sbin/insmod && \
|
||||
ln -sv ../bin/kmod $(ROOT)/sbin/lsmod && \
|
||||
ln -sv ../bin/kmod $(ROOT)/sbin/modinfo && \
|
||||
ln -sv ../bin/kmod $(ROOT)/sbin/modprobe && \
|
||||
ln -sv ../bin/kmod $(ROOT)/sbin/rmmod
|
||||
|
||||
include /usr/share/snap/Makefile.snaplinux
|
||||
|
||||
$(SRCDIR)/configure: $(ARCHIVE)
|
||||
@@ -50,7 +40,8 @@ $(SRCDIR)/configure: $(ARCHIVE)
|
||||
@touch $(SRCDIR)/configure
|
||||
|
||||
$(SRCDIR)/config.log: $(SRCDIR)/configure
|
||||
@cd $(SRCDIR) && for patch in `find $(PATCHDIR) -name \*.patch`; do \
|
||||
@cd $(SRCDIR) && \
|
||||
for patch in `find $(PATCHDIR) -name \*.patch|sort`; do \
|
||||
patch --verbose -Np1 -i $$patch; \
|
||||
done
|
||||
@cd $(SRCDIR); \
|
||||
@@ -66,8 +57,7 @@ $(SRCDIR)/config.log: $(SRCDIR)/configure
|
||||
--target=x86_64-snap-linux-gnu
|
||||
|
||||
$(SRCDIR)/tools/kmod: $(SRCDIR)/config.log
|
||||
@cd $(SRCDIR); \
|
||||
$(MAKE)
|
||||
@cd $(SRCDIR) && make
|
||||
|
||||
$(ROOT): $(SRCDIR)/tools/kmod
|
||||
@if [ -d $(ROOT) ]; then \
|
||||
@@ -76,14 +66,14 @@ $(ROOT): $(SRCDIR)/tools/kmod
|
||||
mkdir -v $(ROOT); \
|
||||
fi
|
||||
|
||||
@cd $(SRCDIR); \
|
||||
$(MAKEINST) DESTDIR=$(ROOT)
|
||||
|
||||
@$(SNAPHACKS)
|
||||
|
||||
test: $(ROOT)
|
||||
@cd $(SRCDIR); \
|
||||
make test
|
||||
@cd $(SRCDIR) && make install DESTDIR=$(ROOT) && \
|
||||
install -v -d -m 755 $(ROOT)/sbin && \
|
||||
ln -sv ../bin/kmod $(ROOT)/sbin/depmod && \
|
||||
ln -sv ../bin/kmod $(ROOT)/sbin/insmod && \
|
||||
ln -sv ../bin/kmod $(ROOT)/sbin/lsmod && \
|
||||
ln -sv ../bin/kmod $(ROOT)/sbin/modinfo && \
|
||||
ln -sv ../bin/kmod $(ROOT)/sbin/modprobe && \
|
||||
ln -sv ../bin/kmod $(ROOT)/sbin/rmmod
|
||||
|
||||
clean:
|
||||
@rm -rvf $(ROOT) \
|
||||
|
||||
Reference in New Issue
Block a user