Skip to content

Commit

Permalink
.make#install: fix compilation of non-shared objects
Browse files Browse the repository at this point in the history
  • Loading branch information
XPhyro committed Jan 17, 2024
1 parent 021ad9a commit 3e16f2e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/.make
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,11 @@ install() {
shared/*|*/shared/*)
out="$out.so"
installprefix="$libprefix"
extraflags=-shared
;;
*)
installprefix="$binprefix"
extraflags=
;;
esac
if [ -f "$installprefix/$out" ] && [ "$installprefix/$out" -nt "$1" ]; then
Expand All @@ -201,7 +203,7 @@ install() {
"$installprefix/$out" \
"$(printf "%s\n" "$flags" | tr -d "\n" | sed "s/^\s\+//;s/\s\+$//;s/\s\+/ /g")" \
"$(printf "%s\n" "$ldflags" | tr -d "\n" | sed "s/^\s\+//;s/\s\+$//;s/\s\+/ /g")"
'"$CC"' '"$CFLAGS"' $flags -shared "$1" '"$CLDFLAGS"' $ldflags -o "$installprefix/$out" \
'"$CC"' '"$CFLAGS"' $flags $extraflags "$1" '"$CLDFLAGS"' $ldflags -o "$installprefix/$out" \
&& printf "\0%s\0" "$installprefix/$out" >> ../.installed
' --
)
Expand Down Expand Up @@ -250,9 +252,11 @@ install() {
shared/*|*/shared/*)
out="$out.so"
installprefix="$libprefix"
extraflags=-shared
;;
*)
installprefix="$binprefix"
extraflags=
;;
esac
if [ -f "$installprefix/$out" ] && [ "$installprefix/$out" -nt "$1" ]; then
Expand All @@ -270,7 +274,7 @@ install() {
"$installprefix/$out" \
"$(printf "%s\n" "$flags" | tr -d "\n" | sed "s/^\s\+//;s/\s\+$//;s/\s\+/ /g")" \
"$(printf "%s\n" "$ldflags" | tr -d "\n" | sed "s/^\s\+//;s/\s\+$//;s/\s\+/ /g")"
'"$CXX"' '"$CXXFLAGS"' $flags -shared "$1" '"$CXXLDFLAGS"' $ldflags -o "$installprefix/$out" \
'"$CXX"' '"$CXXFLAGS"' $flags $extraflags "$1" '"$CXXLDFLAGS"' $ldflags -o "$installprefix/$out" \
&& printf "\0%s\0" "$installprefix/$out" >> ../.installed
' --
)
Expand Down

0 comments on commit 3e16f2e

Please sign in to comment.