-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
162 lines (116 loc) · 4.28 KB
/
Makefile
File metadata and controls
162 lines (116 loc) · 4.28 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
### autorefs
### Well, python is not as smooth as I would have thought ... also, I like the idea of downloading things once. We are back here and trying to expand to DOIs
#### I had tried to switch to a python/entrez approach. Good thing I didn't record where I did that work!
## This is a weird overlap approach
## Work on making autorefs pure service (like webpix); it doesn't need a centralized record
### Hooks
current: target
-include target.mk
##################################################################
Sources = Makefile sub.mk inc.mk .ignore
ms = makestuff
Sources += makestuff
-include sub.mk
-include $(ms)/perl.def
##################################################################
ifndef Drop
Drop = ~/Dropbox
endif
## $(autorefs) needs to be recognized as here by this directory and the client directory
ifndef autorefs
autorefs = .
endif
export bib = $(autorefs)/bib
## Can't make here until you set up an bib directory pointed to by Drop
Makefile: $(bib)
Ignore += bib
$(bib): dir=$(Drop)/autorefs
$(bib):
$(linkdirname)
######################################################################
Sources += $(wildcard *.pl)
Sources += notes.txt
# Make a bib file from .rmu
# .bibrec is called via .bibmk, and kicks off the rest of the chain.
# DOI stuff is kind of working ...
## Parse the .rmu file into something with "integrated" tags (IOW, understand both doi and pubmed references)
Sources += test.rmu
# test.int: test.rmu int.pl
%.int: %.rmu $(autorefs)/int.pl
$(PUSH)
## Make variables so that we can refer to doi identifiers
%.point: %.int $(autorefs)/point.pl
$(PUSH)
######################################################################
## Output formats; first make records, then files
###### .bib #######
## bibrec is a single bibliographic record made from info in .mdl
%.bibrec: %.mdl $(autorefs)/mbib.pl
$(PUSH)
%.bibmk: %.int $(autorefs)/mkmk.pl
$(call PUSHARGS, bibrec)
## Unresolved craziness in NSERC proposal; this rule does not seem to work. Touching .rmu and making .int both fail to put .bib out of date.
.PRECIOUS: %.bib
%.bib: %.int $(autorefs)/pm.pl
$(MAKE) $*.bibmk
$(MAKE) $*.point
$(MAKE) -f $*.point -f $*.bibmk -f $(autorefs)/Makefile bibrec
$(PUSH)
###### .ref #######
## This makes some sort of simple reference list and seems a bit deprecated. Probably doesn't work for DOIs, but might be a simple fix.
%.refrec: %.mdl $(autorefs)/mref.pl
$(PUSH)
%.refmk: %.int $(autorefs)/refmk.pl
$(PUSH)
%.ref: %.int $(autorefs)/ir.pl
$(MAKE) $*.refmk
$(MAKE) -f $*.refmk -f $(autorefs)/Makefile refrec
$(PUSH)
###### .md #######
## Now trying to make a markdown version
## First get the pipeline going, then look for hints from wikitext version on wiki
## In the middle of all this; also, it doesn't seem right, because the markdown should ideally incorporate _text_ from the .rmu (otherwise, why all that work making rmus?
%.mdrec: %.mdl $(autorefs)/mdrec.pl
$(PUSH)
%.mdmk: %.int $(autorefs)/mdmk.pl
$(PUSH)
%.md: %.int $(autorefs)/md.pl
$(MAKE) $*.bib
$(MAKE) $*.mdmk
$(MAKE) -f $*.mdmk -f $(autorefs)/Makefile mdrec
$(PUSH)
######################################################################
## .med is a raw MEDLINE formatted download
## Needed to change just some bib -> $(bib) and only need it sometimes!
.PRECIOUS: $(bib)/%.pm.med
$(bib)/%.pm.med:
$(MAKE) $(bib)
wget -O $@ "http://www.ncbi.nlm.nih.gov/pubmed/$*?dopt=MEDLINE&output=txt"
.PRECIOUS: $(bib)/%.doi.med
$(bib)/%.doi.med:
$(MAKE) $(bib)
curl -o $@ -LH "Accept: application/x-research-info-systems" "http://dx.doi.org/$($*)"
## Corrections
## Some of this is out of date
# To make a correction (or to disambiguate), copy mdl to a .corr file (which we will push)
# ~/Dropbox/bib/98ccd4a361cfed7df91966e068af4ce4.doi.mdl
dcorr: 98ccd4a361cfed7df91966e068af4ce4.doi.corr
## Updated not tested! 27 Jun '17
corr: 19393959.pm.corr
%.corr:
$(MAKE) $(bib)/$*.mdl
$(MV) $(bib)/$*.mdl $@
$(EDIT) $@
$(CP) $@ $(bib)/$*.mdl
Sources += $(wildcard *.corr)
## mdl has parsed fields from .med joined using #AND#
## it also has a default tag created from author and date
## as of 2016 the script attempts to "fill" using second choices
.PRECIOUS: $(bib)/%.mdl
$(bib)/%.mdl: $(bib)/%.med $(autorefs)/mm.pl
$(CP) $*.corr $@ || $(PUSH)
%.rmk:
$(RM) $*
$(MAKE) $*
include $(ms)/git.mk
include $(ms)/visual.mk