This repository has been archived by the owner on Jan 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile
91 lines (78 loc) · 2.9 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#
# Makefile for gemplotting package
#
BUILD_HOME := $(shell dirname `pwd`)
Project := gem-plotting-tools
ShortProject := gemplotting
Namespace := gempython
Package := gemplotting
ShortPackage := gemplotting
LongPackage := gemplotting
PackageName := $(Namespace)_$(ShortPackage)
PackageDir := pkg/$(Namespace)/$(ShortPackage)
ScriptDir := pkg/$(Namespace)/scripts
ManDir := pkg/man
# Explicitly define the modules that are being exported (for PEP420 compliance)
PythonModules = ["$(Namespace).$(ShortPackage)", \
"$(Namespace).$(ShortPackage).utils", \
"$(Namespace).$(ShortPackage).fitting", \
"$(Namespace).$(ShortPackage).macros", \
"$(Namespace).$(ShortPackage).mapping" \
]
$(info PythonModules=${PythonModules})
GEMPLOTTING_VER_MAJOR:=$(shell ./config/tag2rel.sh | awk '{split($$0,a," "); print a[1];}' | awk '{split($$0,b,":"); print b[2];}')
GEMPLOTTING_VER_MINOR:=$(shell ./config/tag2rel.sh | awk '{split($$0,a," "); print a[2];}' | awk '{split($$0,b,":"); print b[2];}')
GEMPLOTTING_VER_PATCH:=$(shell ./config/tag2rel.sh | awk '{split($$0,a," "); print a[3];}' | awk '{split($$0,b,":"); print b[2];}')
include $(BUILD_HOME)/$(Project)/config/mfCommonDefs.mk
include $(BUILD_HOME)/$(Project)/config/mfPythonDefs.mk
include $(BUILD_HOME)/$(Project)/config/mfPythonRPM.mk
default:
$(MakeDir) $(PackageDir)
@cp -rf macros fitting mapping utils $(PackageDir)
@echo "__path__ = __import__('pkgutil').extend_path(__path__, __name__)" > pkg/$(Namespace)/__init__.py
@cp -rf __init__.py $(PackageDir)
# need to ensure that the python only stuff is packaged into RPMs
.PHONY: clean package preprpm
package: default
$(MakeDir) $(ScriptDir)
@cp -rf anaUltra*.py $(ScriptDir)
@cp -rf anaSBit*.py $(ScriptDir)
@cp -rf anaXDAQ*.py $(ScriptDir)
@cp -rf ana_scans.py $(ScriptDir)
@cp -rf anaDACScan.py $(ScriptDir)
@cp -rf anaXDAQLatency.py $(ScriptDir)
@cp -rf packageFiles4Docker.py $(ScriptDir)
.PHONY: doc man cleandoc
doc: package man
$(MAKE) -C $@ docs
man:
-rm -rf $(ManDir)
$(MakeDir) $(ManDir)
USE_CONDA=YES ENV_NAME=condaman $(MAKE) -C doc $@
@cp -rf doc/build/man/* $(ManDir)
@rm -rf $(ManDir)/_static
cleandoc:
$(MAKE) -C doc cleanall
_rpmprep: preprpm
preprpm: package man
@if ! [ -e pkg/installrpm.sh ]; then \
cp -rf config/scriptlets/installrpm.sh pkg/; \
fi
gzip $(ManDir)/*
-cp -rf README.md LICENSE CHANGELOG.md MANIFEST.in requirements.txt $(PackageDir)
-cp -rf README.md LICENSE CHANGELOG.md MANIFEST.in requirements.txt pkg
clean:
-rm -rf $(ScriptDir)
-rm -rf $(PackageDir)
-rm -rf $(ManDir)
-rm -f pkg/$(Namespace)/__init__.py
-rm -f pkg/README.md
-rm -f pkg/LICENSE
-rm -f pkg/MANIFEST.in
-rm -f pkg/CHANGELOG.md
-rm -f pkg/requirements.txt
print-env:
@echo BUILD_HOME $(BUILD_HOME)
@echo GIT_VERSION $(GIT_VERSION)
@echo PYTHON_VERSION $(PYTHON_VERSION)
@echo GEMDEVELOPER $(GEMDEVELOPER)