Skip to content

Commit

Permalink
improve Makefile
Browse files Browse the repository at this point in the history
- Preserve user file ownership when copying the template dkms.conf.am
  to dkms.conf, as 'make dkms' requires running as root
- Clean up generated files VERSION and dkms.conf on 'make dkms_clean'
- Remove redundant `pwd`/ from cp calls
  • Loading branch information
MestreLion committed Nov 3, 2019
1 parent 2d5180f commit aca60d4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ endif
depmod -a -F $(SYSTEM_MAP) $(TARGET)

dkms:
@cp `pwd`/dkms.conf.am `pwd`/dkms.conf
@cp --preserve dkms.conf.am dkms.conf
@sed -i -e '/^PACKAGE_VERSION=/ s/=.*/=\"$(DRIVER_VERSION)\"/' dkms.conf
@echo "$(DRIVER_VERSION)" >VERSION
@mkdir $(DKMS_ROOT_PATH)
@cp `pwd`/dkms.conf $(DKMS_ROOT_PATH)
@cp `pwd`/VERSION $(DKMS_ROOT_PATH)
@cp `pwd`/Makefile $(DKMS_ROOT_PATH)
@cp `pwd`/asus-wmi-sensors.c $(DKMS_ROOT_PATH)
@cp dkms.conf $(DKMS_ROOT_PATH)
@cp VERSION $(DKMS_ROOT_PATH)
@cp Makefile $(DKMS_ROOT_PATH)
@cp asus-wmi-sensors.c $(DKMS_ROOT_PATH)
@dkms add -m $(DRIVER) -v $(DRIVER_VERSION)
@dkms build -m $(DRIVER) -v $(DRIVER_VERSION)
@dkms install --force -m $(DRIVER) -v $(DRIVER_VERSION)
Expand All @@ -107,3 +107,4 @@ dkms_clean:
fi
@dkms remove -m $(DRIVER) -v $(DRIVER_VERSION) --all
@rm -rf $(DKMS_ROOT_PATH)
@rm -- VERSION dkms.conf

0 comments on commit aca60d4

Please sign in to comment.