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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:36:45+00:00 2026-05-14T16:36:45+00:00

I am working on Solaris 10, Sun Studio 11. I am refactoring some old

  • 0

I am working on Solaris 10, Sun Studio 11. I am refactoring some old code, and trying to write unit tests for them. My make file looks like:

my_model.o:my_model.cc
    CC -c my_model.cc -I/../../include -library=stlport4 -instances=extern

unit_test: unit_test.o my_model.o symbol_dictionary.o
    CC -o unit_test unit_test.o my_model.o symbol_dictionary.o -I../../include \
    -library=stlport4 -instances=extern

unit_test.o: unit_test.cc
    CC -c unit_test.cc -I/../../include -library=stlport4 -instances=extern

symbol_dictionary.o:
    cd ../../test-fixtures && ($MAKE) symbol_dictionary.o
    mv ../../test-fixtures/symbol_dictionary.o .

In the ../../test-fixtures makefile, I have the following target:

symbol_dictionary.o:
    CC -c symbol_dictionary.cc -I/../../include -library=stlport4 -instances=extern

I do the instances=extern because I had linking problems before, and this was the recommended solution. The consequence is in each directory that is being compiled, a SunWS_Cache directory is created to store the template instances.

This is the long way to get to this question. Is it a standard practice to consolidate object files in a single directory before you link them?

  • 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-14T16:36:45+00:00Added an answer on May 14, 2026 at 4:36 pm

    Short answer: it is a common practice, often convenient, not always good, not always bad.

    Also, your makefiles can be shorter and cleaner if you use automatic variables and pattern rules:

    COMPILE = CC -I/../../include -library=stlport4 -instances=extern
    
    %.o: %.cc
        $(COMPILE) -c $<
    
    unit_test: unit_test.o my_model.o symbol_dictionary.o
        $(COMPILE) -o $@ $^
    
    symbol_dictionary.o:
        cd ../../test-fixtures && ($MAKE) $@
        mv ../../test-fixtures/$@ .
    

    in ../../test:

    COMPILE = CC -I/../../include -library=stlport4 -instances=extern
    
    symbol_dictionary.o: %.o : %.cc
        $(COMPILE) -c $<
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been working on a project of porting an old solaris CL program to
On a Solaris 5.8 machine, I have the following code: [non-working code] char *buf;
I am trying to get remote debugging working with Java on Solaris OS. Following
I am trying to write a code that checkpoints multithreaded applications. Since fork function
I am working on different platforms (Solaris/Windows). I need to create a File object
Ok, I have been working with Solaris for a 10+ years, and have never
I'm working on a solaris box. How do I go about deleting all files
I'm working on a command line application for Solaris, written in Java6. I'd like
i have a working solaris 10 server with ssh and NIS using the following
May God never give you the bane of working on Solaris. Now, I am

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.