Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile changes #47

Merged
merged 4 commits into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 18 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
SUBDIRS = src conf doc module test

.PHONY: all
all:
for i in $(SUBDIRS); do cd $$i; make; cd ..; done
all: $(SUBDIRS)

.PHONY: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@ $(MAKECMDGOALS)

.PHONY: clean
clean: $(SUBDIRS)

.PHONY: install
install:
for i in $(SUBDIRS); do cd $$i; make install; cd ..; done
install: $(SUBDIRS)

.PHONY: uninstall
uninstall:
for i in $(SUBDIRS); do cd $$i; make uninstall; cd ..; done

.PHONY: clean
clean:
for i in $(SUBDIRS); do cd $$i; make clean; cd ..; done
uninstall: $(SUBDIRS)

.PHONY: dkms-install
dkms-install:
cd module; make dkms-install; cd ..
$(MAKE) -C module $@

.PHONY: dkms-uninstall
dkms-uninstall:
cd module; make dkms-uninstall; cd ..
$(MAKE) -C module $@

.PHONY: tools-install
tools-install:
cd src; make; make install; \
cd ../conf; make install; \
cd ../doc; make install; cd ..
$(MAKE) -C src install
$(MAKE) -C conf install
$(MAKE) -C doc install

.PHONY: tools-uninstall
tools-uninstall:
cd src; make uninstall; \
cd ../conf; make uninstall; \
cd ../doc; make uninstall; cd ..
$(MAKE) -C src uninstall
$(MAKE) -C conf uninstall
$(MAKE) -C doc uninstall
15 changes: 7 additions & 8 deletions module/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ifeq ($(KSRC),)
endif

ifeq ($(KVER),)
KVER := $(shell uname -r)
KVER := $(shell uname -r)
endif

MKDIR := mkdir -pv
Expand All @@ -34,9 +34,9 @@ obj-m += rapiddisk.o
obj-m += rapiddisk-cache.o

all:
$(MAKE) -C$(KSRC) M=$(PWD)
$(MAKE) -C $(KSRC) M=$(CURDIR)

install:
install: all
$(MKDIR) $(DESTDIR)/lib/modules/$(KVER)/kernel/drivers/block/
install -o root -g root -m 0755 rapiddisk.ko $(DESTDIR)/lib/modules/$(KVER)/kernel/drivers/block/
install -o root -g root -m 0755 rapiddisk-cache.ko $(DESTDIR)/lib/modules/$(KVER)/kernel/drivers/block/
Expand All @@ -51,18 +51,17 @@ clean:
rm -rf *.o *.ko *.symvers *.mod.c .*.cmd Module.markers modules.order *.o.* built-in*
rm -rf .tmp_versions .rapiddisk.o.d *.unsigned *.sdtinfo.c .ctf/ .cache.mk *.mod

dkms-install:
dkms-install: clean uninstall
ifeq ($(shell which dkms >/dev/null 2>/dev/null; echo $$?),1)
$(error No 'dkms' command found)
else ifeq ($(shell dkms status rapiddisk/$(VERSION) -k $(KVER) | grep '$(KVER)' >/dev/null 2>/dev/null; echo $$?),0)
$(error rapiddisk version $(VERSION) is already installed for kernel $(KVER). Use 'make dkms-uninstall' first)
else
[ ! -d $(DKMSDEST) ] && $(MKDIR) $(DKMSDEST) || true
$(CP) $(DKMSFILES) $(DKMSDEST)
dkms install rapiddisk/$(VERSION) -k $(KVER) .
dkms add . || true
dkms install rapiddisk/$(VERSION) -k $(KVER)
endif

dkms-uninstall:
dkms-uninstall: clean uninstall
ifeq ($(shell which dkms >/dev/null 2>/dev/null; echo $$?),1)
$(error No 'dkms' command found)
else ifeq ($(shell dkms status rapiddisk/$(VERSION) -k $(KVER) | grep '$(KVER)' >/dev/null 2>/dev/null; echo $$?),0)
Expand Down
2 changes: 1 addition & 1 deletion module/dkms.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ BUILT_MODULE_NAME[1]="rapiddisk-cache"
DEST_MODULE_LOCATION[0]="/kernel/rapiddisk/"
DEST_MODULE_LOCATION[1]="/kernel/rapiddisk/"
AUTOINSTALL="yes"
REMAKE_INITRD=yes
REMAKE_INITRD="yes"
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ install: all
$(MKDIR) $(DESTDIR)$(DIR)
$(CP) $(BIN) $(DESTDIR)$(DIR)
$(CHMOD) 755 $(DESTDIR)$(DIR)/$(BIN)*
ln -s $(BIN) $(DESTDIR)$(DIR)/rxadm
if [ ! -L $(DESTDIR)$(DIR)/rxadm ] ; then ln -s $(BIN) $(DESTDIR)$(DIR)/rxadm ; fi

.PHONY: uninstall
uninstall:
Expand Down