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 7614785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:29:29+00:00 2026-05-31T02:29:29+00:00

Here is the makefile: LIBDIRS += ./libRelease LIBDIRS += ./SharedArcGIS/DepFilesLinux64/LibReleaseLinux64/Skia LIBDIRS += ./SharedArcGIS/DepFilesLinux64/LibReleaseLinux64/LibTess LIBDIRS

  • 0

Here is the makefile:

LIBDIRS       += ./libRelease
LIBDIRS       += ./SharedArcGIS/DepFilesLinux64/LibReleaseLinux64/Skia
LIBDIRS       += ./SharedArcGIS/DepFilesLinux64/LibReleaseLinux64/LibTess
LIBDIRS       += ./SharedArcGIS/DepFilesLinux64/LibReleaseLinux64/SQLite
STATICS       = $(wildcard $(LIBDIRS:=/*.a))
TARGETA       = libRuntimeCoreJava.a
TARGETD       = libRuntimeCoreJava.so
TARGETD1      = $(TARGETD).1
TARGETD2      = $(TARGETD).1.0
TARGETD3      = $(TARGETD).1.0.0
AR            = ar cqs
AR_EXTRACT    = ar -x
LINK          = g++
SYMLINK       = ln -f -s
LDFLAGS       = -shared -Wl,-soname,libRuntimeCoreJava.so
EXTRACT       =

all : $(TARGETD) $(TARGETA)

$(TARGETD) : clean
        mkdir -p ./obj ./libRelease
        $(foreach lib, $(STATICS), cp $(lib) ./obj;)
        $(eval EXTRACT := $(wildcard ./obj/*.a))
        echo $(EXTRACT)
        $(foreach lib, $(EXTRACT), $(AR_EXTRACT) $(lib);)
        $(foreach lib, $(EXTRACT), rm -f $(lib);)

        #$(CXX) $(LDFLAGS) $(OBJS)
        #$(SYMLINK) $(TARGETD) $(TARGETD1)
        #$(SYMLINK) $(TARGETD) $(TARGETD2)
        #$(SYMLINK) $(TARGETD) $(TARGETD3)

$(TARGETA) :
        $(eval OBJS:=$(wildcard ./obj/*.o))
        echo $(OBJS)
        #$(AR) $(TARGETA) $(OBJS)

clean :
        rm -rf ./ob

Here is the output:

[matt6809@hogganz400 ArcGIS2]$ ls -l ./obj
total 23332
-rw-rw-r-- 1 matt6809 matt6809  191324 Mar  7 09:18 libCommon.a
-rw-rw-r-- 1 matt6809 matt6809 8427134 Mar  7 09:18 libGeometryXLib.a
-rw-rw-r-- 1 matt6809 matt6809   88580 Mar  7 09:18 libLibTess.a
-rw-rw-r-- 1 matt6809 matt6809 3401554 Mar  7 09:18 libMapping.a
-rw-rw-r-- 1 matt6809 matt6809 3558746 Mar  7 09:18 libpe_s.a
-rw-rw-r-- 1 matt6809 matt6809  412634 Mar  7 09:18 libpe++_s.a
-rw-rw-r-- 1 matt6809 matt6809  597808 Mar  7 09:18 libsg_s.a
-rw-rw-r-- 1 matt6809 matt6809 3523726 Mar  7 09:18 libSkia.a
-rw-rw-r-- 1 matt6809 matt6809  730064 Mar  7 09:18 libSQLite.a
-rw-rw-r-- 1 matt6809 matt6809  814234 Mar  7 09:18 libSymbolDictionary.a
-rw-rw-r-- 1 matt6809 matt6809 2128742 Mar  7 09:18 libSymbolXLib.a
[matt6809@hogganz400 ArcGIS2]$ make
rm -rf ./obj
mkdir -p ./obj ./libRelease
cp ./libRelease/libCommon.a ./obj;  cp ./libRelease/libGeometryXLib.a ./obj;  cp ./libRelease/libMapping.a ./obj;  cp ./libRelease/libpe_s.a ./obj;  cp ./libRelease/libpe++_s.a ./obj;  cp ./libRelease/libsg_s.a ./obj;  cp ./libRelease/libSymbolDictionary.a ./obj;  cp ./libRelease/libSymbolXLib.a ./obj;  cp ./SharedArcGIS/DepFilesLinux64/LibReleaseLinux64/Skia/libSkia.a ./obj;  cp ./SharedArcGIS/DepFilesLinux64/LibReleaseLinux64/LibTess/libLibTess.a ./obj;  cp ./SharedArcGIS/DepFilesLinux64/LibReleaseLinux64/SQLite/libSQLite.a ./obj;
echo 

#g++ -shared -Wl,-soname,libRuntimeCoreJava.so 
#ln -f -s libRuntimeCoreJava.so libRuntimeCoreJava.so.1
#ln -f -s libRuntimeCoreJava.so libRuntimeCoreJava.so.1.0
#ln -f -s libRuntimeCoreJava.so libRuntimeCoreJava.so.1.0.0
echo 

#ar cqs libRuntimeCoreJava.a 

Why is EXTRACT empty? The output show that the libs were copied over to the .obj file.

  • 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-05-31T02:29:30+00:00Added an answer on May 31, 2026 at 2:29 am

    Each command line in your rule is considered to be a ‘recipe’, and each recipe will invoke a new instance of shell to run. Thus, when you set a value for EXTRACT in one recipe, and try to read it in another, you are reading from two different shell instances, and the value does not carry between them. One way to get around this is to join your commands into a single recipe as so:

    $(TARGETD) : clean
            mkdir -p ./obj ./libRelease;  \
            for lib in $(STATICS) do; cp $$lib ./obj; done; \
            EXTRACT=`ls ./obj/*.a`; echo $$EXTRACT; \
            for lib in $$EXTRACT do; $(AR_EXTRACT) $$lib done; \
            for lib in $$EXTRACT do; rm -f $$lib; done; \
    

    Thus, when you set EXTRACT, it will be available for all the commands within your recipe.

    See http://www.gnu.org/software/make/manual/make.html#Recipes for more info

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

Sidebar

Related Questions

Firstly, here's my Makefile, it's really, really cool. It generates an executable for every
Here is the makefile: CC = g++ LD = g++ CFLAGS = -I/usr/X11R6/include -I.
Suppose I have a Makefile: all: $(BINARY) $(BINARY): $(OBJS) $(DEBUG_OBJS) #Link objects here $(OBJS):
Here's some pseudocode for what I want my makefile to do: if (A doesn't
here is my makefile: sandbox:sandbox.o ld -o sandbox sandbox.o sandbox.o:sandbox.asm nasm -f elf -g
Here is my Makefile: .PHONY: all homework1 CFLAGS= -g -O0 -Wall -Werror -Wno-unused-function LDFLAGS=
Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here's a problem I ran into recently. I have attributes strings of the form
Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior

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.