Also test brp-llvm-compile-lto-elf on object file
This serves the dual purpose on making sure that plain object files can also be converted to ELF, and that the script handles more than a single file.
This commit is contained in:
parent
88a50692ec
commit
820c23a121
@ -18,17 +18,19 @@ Source1: %{name}.h
|
|||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
clang ${CFLAGS} -c %{SOURCE0} -o lib.o
|
clang ${CFLAGS} -c %{SOURCE0} -o %{name}.o
|
||||||
ar cr %{name}.a lib.o
|
ar cr %{name}.a %{name}.o
|
||||||
ranlib %{name}.a
|
ranlib %{name}.a
|
||||||
|
|
||||||
%install
|
%install
|
||||||
mkdir -p %{buildroot}%{_libdir}
|
mkdir -p %{buildroot}%{_libdir}
|
||||||
mkdir -p %{buildroot}%{_includedir}
|
mkdir -p %{buildroot}%{_includedir}
|
||||||
|
|
||||||
|
%{__install} -p -m 644 -t %{buildroot}%{_libdir} %{name}.o
|
||||||
%{__install} -p -m 644 -t %{buildroot}%{_libdir} %{name}.a
|
%{__install} -p -m 644 -t %{buildroot}%{_libdir} %{name}.a
|
||||||
%{__install} -p -m 644 -t %{buildroot}%{_includedir} %{SOURCE1}
|
%{__install} -p -m 644 -t %{buildroot}%{_includedir} %{SOURCE1}
|
||||||
|
|
||||||
%files
|
%files
|
||||||
|
%{_libdir}/%{name}.o
|
||||||
%{_libdir}/%{name}.a
|
%{_libdir}/%{name}.a
|
||||||
%{_includedir}/%{name}.h
|
%{_includedir}/%{name}.h
|
||||||
|
@ -18,7 +18,9 @@ Source0: %{name}.c
|
|||||||
|
|
||||||
%build
|
%build
|
||||||
gcc ${CFLAGS} -c %{SOURCE0} -o %{name}.o
|
gcc ${CFLAGS} -c %{SOURCE0} -o %{name}.o
|
||||||
gcc ${LDFLAGS} %{name}.o %{_libdir}/%{name}-lib.a -o %{name}
|
gcc ${LDFLAGS} %{name}.o %{_libdir}/%{name}-lib.a -o %{name}-ar
|
||||||
|
gcc ${LDFLAGS} %{name}.o %{_libdir}/%{name}-lib.o -o %{name}-obj
|
||||||
|
|
||||||
%check
|
%check
|
||||||
./%{name} | grep "Hello, world!"
|
./%{name}-ar | grep "Hello, world!"
|
||||||
|
./%{name}-obj | grep "Hello, world!"
|
||||||
|
Loading…
Reference in New Issue
Block a user