Skip to content

Commit

Permalink
refactor: Making the build more generic.
Browse files Browse the repository at this point in the history
* VERSION changed to CONFIG as it contains more vars now.
* PKG_NAME introduced.
* RPM_RELEASE generic for any rpm based distro.
  • Loading branch information
jerzyjamroz committed Jan 30, 2024
1 parent 54afc73 commit e2142b9
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
8 changes: 8 additions & 0 deletions mrmShared/linux/CONFIG
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Version definition for driver

# Package control vars
PKG_NAME := mrfioc2-dkms
DRV_NAME := mrf

# 20240124 Release
DRV_VERSION := 3
2 changes: 1 addition & 1 deletion mrmShared/linux/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
KERNELDIR ?= /lib/modules/$(shell uname -r)/build

include VERSION
include CONFIG

all: modules

Expand Down
4 changes: 0 additions & 4 deletions mrmShared/linux/VERSION

This file was deleted.

8 changes: 3 additions & 5 deletions mrmShared/linux/dkms-rpm/CONFIG
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Specify the group for the MRF driver user here

# NOTE: group root can be adjusted by the configuration tool
DRV_GROUP = root
RPM_RELEASE = 1
DRV_NAME = mrf
RPM_NAME = mrfioc2-dkms
DIST ?= el7
DRV_GROUP := root
RPM_RELEASE := 1
# NOTE: Not necessary DIST ?= el7
8 changes: 4 additions & 4 deletions mrmShared/linux/dkms-rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

SRCDIR = $(CURDIR)/..

include $(SRCDIR)/VERSION
include $(SRCDIR)/CONFIG
include CONFIG

# Determine the architecture of the machine
Expand All @@ -15,7 +15,7 @@ ARCH := $(shell uname -m)
# for information on RPM versioning. We'll want to obey these rules if we can.
RPM_VERSION = $(DRV_VERSION)

RPM_FILE = $(RPM_NAME)-$(RPM_VERSION)-$(RPM_RELEASE).$(DIST).$(ARCH).rpm
RPM_FILE = $(PKG_NAME)-$(RPM_VERSION)-$(RPM_RELEASE).$(ARCH).rpm

driver-rpm: $(RPM_FILE)
.PHONY: driver-rpm
Expand All @@ -33,9 +33,9 @@ SED_SUBSTS += s/@@RPM_VERSION@@/$(RPM_VERSION)/g;
SED_SUBSTS += s/@@DRV_GROUP@@/$(DRV_GROUP)/g;
SED_SUBSTS += s/@@RPM_RELEASE@@/$(RPM_RELEASE)/g;
SED_SUBSTS += s/@@ARCH@@/$(ARCH)/g;
SED_SUBSTS += s/@@RPM_NAME@@/$(RPM_NAME)/g;
SED_SUBSTS += s/@@PKG_NAME@@/$(PKG_NAME)/g;

%: %.in CONFIG $(SRCDIR)/VERSION
%: %.in CONFIG $(SRCDIR)/CONFIG
sed '$(SED_SUBSTS)' $< >$@

SED_FILES = dkms.conf $(DRV_NAME).spec 50-mrf.rules
Expand Down
4 changes: 2 additions & 2 deletions mrmShared/linux/dkms-rpm/mrf.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

Summary: DKMS mrfioc2 kernel module

Name: @@RPM_NAME@@
Name: @@PKG_NAME@@
Version: @@RPM_VERSION@@
Release: @@RPM_RELEASE@@%{?dist}
Release: @@RPM_RELEASE@@

Vendor: EPICS Community
License: EPICS Open License
Expand Down

0 comments on commit e2142b9

Please sign in to comment.