Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9240353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:10:25+00:00 2026-06-18T08:10:25+00:00

I want to replace the string libswscale.so.2 by libswscale.so (variables called $(SLIBNAME_WITH_MAJOR) and $(SLIBNAME)

  • 0

I want to replace the string libswscale.so.2 by libswscale.so (variables called $(SLIBNAME_WITH_MAJOR) and $(SLIBNAME), respectively). This is what I tried in the Makefile:

$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver
    [...]
    @echo SHFLAGS=$(SHFLAGS)
    @echo SLIBNAME_WITH_MAJOR=$(SLIBNAME_WITH_MAJOR)
    @echo SLIBNAME=$(SLIBNAME)
    @echo A $(patsubst $(SLIBNAME_WITH_MAJOR),$(SLIBNAME),$(SHFLAGS))
    @echo B $(SHFLAGS:$(SLIBNAME_WITH_MAJOR)=$(SLIBNAME))
    @echo C $($(SHFLAGS):$(SLIBNAME_WITH_MAJOR)=$(SLIBNAME))
    @echo D $(SHFLAGS:$(SLIBNAME_WITH_MAJOR)=$(SLIBNAME))
    @echo E $(subst $(SLIBNAME_WITH_MAJOR),$(SLIBNAME),$(SHFLAGS))
    @echo F $(subst l,L,$(SHFLAGS))

The output is

SHFLAGS=-shared -Wl,-soname,libswscale.so.2 -Wl,-Bsymbolic -Wl,--version-script,libswscale/libswscale.ver
SLIBNAME_WITH_MAJOR=libswscale.so.2
SLIBNAME=libswscale.so
A -shared -Wl,-soname,libswscale.so.2 -Wl,-Bsymbolic -Wl,--version-script,libswscale/libswscale.ver
B -shared -Wl,-soname,libswscale.so.2 -Wl,-Bsymbolic -Wl,--version-script,libswscale/libswscale.ver
C
D -shared -Wl,-soname,libswscale.so.2 -Wl,-Bsymbolic -Wl,--version-script,libswscale/libswscale.ver
E -shared -Wl,-soname,libswscale.so.2 -Wl,-Bsymbolic -Wl,--version-script,libswscale/libswscale.ver
F -shared -WL,-soname,libswscale.so.2 -WL,-BsymboLic -WL,--version-script,LibswscaLe/LibswscaLe.ver

The last one (F) is especially ridiculous. What is wrong here? Is it because $(SHFLAGS) is made up of variables as well?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T08:10:27+00:00Added an answer on June 18, 2026 at 8:10 am

    Found it: $(SHFLAGS) was defined as

    SHFLAGS=-shared -Wl,-soname,$$(@F) blablafoo
    

    and using any substitution on it would not work until $$(@F) is actually evaluated (in my case to libswscale.so.2).

    I solved it by replacing the variable reference:

    @echo $(subst $$(@F),$(SLIBNAME),$(SHFLAGS))
    

    Small hint on assignments: VAR = $(OTHERVAR) is evaluated when used, VAR := $(OTHERVAR) is evaluated immediately.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to replace (whole string) $(TOPDIR)/$(OSSCHEMASDIRNAME) with /udir/makesh/$(OSSCHEMASDIRNAME) in a makefile I tried
I want replace the String TaskID_1 with a sequence starting from 1001 and this
I want to replace string data with another string data. I have tried to
I want to use replace-string command to achieve this function, but how to type
Let's say I have this string: 3+5+6+2^5+9+1+2+32^2+10^10 I want to replace all occurrences of
why this regex not work? i want to replace my string by all not
I Want Replace String ':' by '/', I am Using this code to replace
I have following string hello[code:1], world [code:2], hello world I want to replace this
I am using c# regex.replace and I want to replace this string: test =
Using preg_replace() , I want to replace a string like this... aaabbbccc => aaa******

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.