File: make_ref.include

package info (click to toggle)
slurm-wlm 25.05.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 51,772 kB
  • sloc: ansic: 546,579; exp: 61,212; python: 20,435; sh: 10,326; javascript: 6,528; makefile: 4,222; perl: 3,717; pascal: 131
file content (47 lines) | stat: -rw-r--r-- 1,755 bytes parent folder | download | duplicates (5)
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
# 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 libtool" >>"$@"
	$(AM_V_at)echo "# (Not really... but we need libtool to believe it was.)" >>"$@"
	$(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