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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:53:11+00:00 2026-06-09T20:53:11+00:00

Question as title. Netbeans does not offer pre- or postbuild steps and also does

  • 0

Question as title.

Netbeans does not offer pre- or postbuild steps and also does not offer this setting by default. Is there any convinient way I can make this work or can I edit some configs?
I think the makefile is getting regenerated when you add files etc.

I heavily rely on header only libs like boost or glm and my productivity depends on precompiled headers since it makes the code compile so much faster.

I use mingw as a compiler suite on windows and as language C++.


EDIT

My modified makefile after the first suggestion:

# Environment 
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin


# build
build: .build-post

.build-pre:
# Add your pre 'build' code here...
NightLight.hpp.gch: Nightlight.hpp 
    $(COMPILE.cc) $(CXXFLAGS) -g NightLight.hpp

.build-post: .build-impl
# Add your post 'build' code here...


# clean
clean: .clean-post

.clean-pre:
# Add your pre 'clean' code here...

.clean-post: .clean-impl
# Add your post 'clean' code here...
    $(RM) pch.h.gch
  • 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-09T20:53:12+00:00Added an answer on June 9, 2026 at 8:53 pm

    you have to add NightLight.hpp.gch after .build-pre: so that it is dependent on your target and will execute your target

    example:

    .build-pre: NightLight.hpp.gch
    # Add your pre 'build' code here...
    NightLight.hpp.gch: Nightlight.hpp 
        $(COMPILE.cc) $(CXXFLAGS) -g NightLight.hpp
    

    the problem with this approach is that you must have the exact $(CXXFLAGS) as in the other makefiles or your .gch will just be ignored and you have to set them manually for debug/release etc. (look at how $(CXXFLAGS) is defined in i.e. “Makefile-Debug.mk” in your nbproject folder and replace it in your makefile)
    netbeans sucks with precompiled headers as far as i know

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

Sidebar

Related Questions

Although the question title appears a bit subjective I am sure there is not
[Apologies if my question title does not accurately describe my problem- if you can
The question title is a bit strange because I'm not exactly sure how to
I guess the question title sums it up. Is there a time when it
This question title is likely to be worded poorly so feel free to adjust.
Excuse the terrible question title. I have this PHP string and want to check
Although the question title is duplicate of many discussions, I did not find a
The question title is probably not correct because part of my question is to
the question title seems pretty confusing, but this is what i want to achieve.
note: question title is change as discussed in this meta Q&A I'm using the

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.