| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| The following test script shows what I'm attempting to do. It will end up in a make file translating a make macro for library list into a macro for target dependency. pre_fix=lib suffix=.so echo Starting with: echo -L/usr/local/lib -ltom -ldick -lharry -L/usr/lib -ljane -ldoe echo -L/usr/local/lib -ltom -ldick -lharry -L/usr/lib -ljane -ldoe | sed -r \ -e 's|(-l)([^ ]+)|'$pre_fix'\2'$suffix'|g' \ -e ':a;s|(([ ]*-L)([^ ]+))+([ ]+)+('$pre_fix'[^ ]+)+|\1 \3/\5|g;ta' # Use lines below if not GNU sed and -r option #-e 's|\(-l\)\([^ ]\+\)|'$pre_fix'\2'$suffix'|g' \ #-e 's|\(\([ ]*-L\)\([^ ]\+\)\)\+\([ ]\+\)\+\('$pre_fix'[^ ]\+\)\+| \3/\5|g' Current output is: sh junk.txt Starting with: -L/usr/local/lib -ltom -ldick -lharry -L/usr/lib -ljane -ldoe -L/usr/local/lib /usr/local/lib/libtom.so libdick.so libharry.so -L/ usr/lib /usr/lib/libjane.so libdoe.so should look like this when done: /usr/local/lib/libtom.so /usr/local/lib/libdick.so /usr/local/lib/ libharry.so /usr/lib/libjane.so /usr/lib/libdoe.so |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.