xref: /illumos-gate/usr/src/test/elf-tests/tests/sections/shf-exclude/Makefile.test (revision 430062b0bc38ddbe5eda3921705af71cd2c44260)
1#
2# This file and its contents are supplied under the terms of the
3# Common Development and Distribution License ("CDDL"), version 1.0.
4# You may only use this file in accordance with the terms of version
5# 1.0 of the CDDL.
6#
7# A full copy of the text of the CDDL should have accompanied this
8# source.  A copy of the CDDL is also available via the Internet at
9# http://www.illumos.org/license/CDDL.
10#
11
12# Copyright 2021, Richard Lowe.
13
14OBJS= exclude.o stub.o
15
16# Allow building out of the test harness easily too
17SRCDIR=$(PWD)
18
19.KEEP_STATE:
20
21all: $(OBJS)
22
23%.o: $(SRCDIR)/%.c
24	gcc -m64 -c $< -o $@
25
26%.o: $(SRCDIR)/%.s
27	gcc -D_ASM -m64 -c $< -o $@
28
29clean:
30	rm -rf $(OBJS)
31
32test.kmod: exclude.o stub.o
33	gcc -m64 -Wl,-ztype=kmod exclude.o stub.o -o test.kmod
34
35test.so: exclude.o stub.o
36	gcc -m64 -shared exclude.o stub.o -o test.so
37
38test.exec: exclude.o stub.o
39	gcc -m64 exclude.o stub.o -o test.exec
40
41test.o: exclude.o stub.o
42	ld -zfatal-warnings -r exclude.o stub.o -o test.o
43