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

  • Home
  • SEARCH
  • 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 6949105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:54:40+00:00 2026-05-27T13:54:40+00:00

can compiler options be applied selectively on my files? I want some files to

  • 0

can compiler options be applied selectively on my files?
I want some files to be covered by some option but not the other files.

  • 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-27T13:54:40+00:00Added an answer on May 27, 2026 at 1:54 pm

    Guessing that you might be using Make files:

    This should get you started: Note how -fopenmp gets added just for source2.c

    CC=gcc
    SRC=source1.c source2.c
    OBJ=$(patsubst %.c,%.o,$(SRC))
    EXE=source1.exe
    FLAGS= -g -O2
    
    source2.o: FLAGS+=-fopenmp
    
    all: $(EXE)
    
    $(EXE): $(OBJ)
        $(CC) -o $@ $^ $(FLAGS)
    
    %.o: %.c
        $(CC) -c -o $@ $^ $(FLAGS)
    
    clean:
        rm $(EXE)$
    

    Output of make -Bsn:

    gcc -o source1.o source1.c -g -O2
    gcc -o source2.o source2.c -g -O2 -fopenmp
    gcc -o source1 source1.o source2.o -g -O2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Where I can change compiler options for C# project in VisualStudio 2008 (without command
Although the MTASC command-line compiler can compile ActionScript class files into an SWF ,
Can a C++ compiler produce a not so good binary? You can think here
Although the Flex command-line compiler (mxmlc) can compile MXML + ActionScript files into SWFs
Just out of curiosity: I know I can tell the compiler if I want
My system compiler (gcc42) works fine with the TR1 features that I want, but
As you know, /GS are Visual C++ Compiler or Linker Options. Can i Specify
The v4 series of the gcc compiler can automatically vectorize loops using the SIMD
C# doesn't require you to specify a generic type parameter if the compiler can
Can any Flash compiler put specific scripts on specific frames of the Flash movie

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.