forked from SchedMD/slurm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_ref.include
46 lines (39 loc) · 1.67 KB
/
make_ref.include
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
# This is common code for a Makefile.am and creates $(LIB_REF) to be used
# afterwards in noinst_LTLIBRARIES and EXTRA_slurmrestd_DEPENDENCIES
#
# usage
#
# REF = usage.txt
# include $(top_srcdir)/make_ref.include
# noinst_LTLIBRARIES [+]= $(LIB_REF)
# EXTRA_$PROGRAMNAME_DEPENDENCIES [+]= $(LIB_REF)
# $PROGRAMNAME_LDADD += $(LIB_REF)
#
# What the above lines do is include this file in a Makefile.am
# It will insert usage.txt as a variable that the calling program can access
# with the calls in src/common/ref.h.
#
# If I where doing this for the slurmrestd I would put 'slurmrestd' in for
# $PROGRAMNAME i.e. EXTRA_slurmrestd_DEPENDENCIES, slurmrestd_LDADD.
CLEANFILES += *.bino
BIN_REF = $(REF:.txt=.bino)
%.bino: %.txt
$(AM_V_GEN)curr_dir=$(shell pwd); cd $(abs_srcdir); $(LD) -r -o "$(abs_builddir)/$*.bino" -z noexecstack --format=binary "$(notdir $<)"; cd $$curr_dir
$(AM_V_at)@OBJCOPY@ --rename-section .data=.rodata,alloc,load,readonly,data,contents "$*.bino"
lib_ref.lo: $(BIN_REF)
$(AM_V_at)echo "# $@ - a libtool object file" >"$@"
$(AM_V_at)echo "# Generated by $(shell @LIBTOOL@ --version | head -n 1)" >>"$@"
$(AM_V_at)echo "#" >>"$@"
$(AM_V_at)echo "# Please DO NOT delete this file!" >>"$@"
$(AM_V_at)echo "# It is necessary for linking the library." >>"$@"
$(AM_V_at)echo >>"$@"
$(AM_V_at)echo "# Name of the PIC object." >>"$@"
$(AM_V_at)echo "pic_object='$(BIN_REF)'" >>"$@"
$(AM_V_at)echo >>"$@"
$(AM_V_at)echo "# Name of the non-PIC object" >>"$@"
$(AM_V_at)echo "non_pic_object=''" >>"$@"
$(AM_V_at)echo >>"$@"
LIB_REF = lib_ref.la
# a blank lib_ref_la_SOURCES is needed for 'make cscope' to work correctly.
lib_ref_la_SOURCES =
lib_ref_la_LIBADD = lib_ref.lo