DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Introducing Graph Concepts in Java With Eclipse JNoSQL
  • How to Build Real-Time BI Systems: Architecture, Code, and Best Practices
  • How To Build Resilient Microservices Using Circuit Breakers and Retries: A Developer’s Guide To Surviving
  • Accelerating Debugging in Integration Testing: An Efficient Search-Based Workflow for Impact Localization

Trending

  • Monolith: The Good, The Bad and The Ugly
  • How To Introduce a New API Quickly Using Quarkus and ChatGPT
  • How to Create a Successful API Ecosystem
  • Build a Simple REST API Using Python Flask and SQLite (With Tests)
  1. DZone
  2. Coding
  3. Frameworks
  4. Build and Clean Selected Files in Eclipse CDT

Build and Clean Selected Files in Eclipse CDT

Are you working in a tight development spiral? You make changes to files that propagate to a massive project build. But you just need to verify that the files you're working on will build. Here's an easy way to do that.

By 
Erich Styger user avatar
Erich Styger
·
May. 31, 16 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
23.8K Views

Join the DZone community and get the full member experience.

Join For Free

Sometimes it is very useful to clean or build a selected set of files. For this I select the file(s) in the Eclipse Project Explorer and use the context menu:

Build Selected Files

Build Selected Files

This is handy to quickly check if a source modification builds fine, without the need to rebuild a large set of files:

09:55:47 **** Building Selected Files of configuration Debug for project FRDM-K64F_Fusion ****
Info: Internal Builder is used for build
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 "-I..\\Generated_Code" -I../Sources -I../Project_Settings/Startup_Code "-IC:\\nxp\\KDS_3.2.0\\eclipse\\ProcessorExpert/lib/Kinetis/iofiles" "-IC:\\nxp\\KDS_3.2.0\\eclipse\\ProcessorExpert/lib/Kinetis/pdd/inc" "-IC:/Users/Erich Styger/Data/HSLU/Vorlesung/nemesis/CCE/Eck/KDS/FRDM_K64F_Fusion/Sources" "-IC:/Users/Erich Styger/Data/HSLU/Vorlesung/nemesis/CCE/Eck/KDS/FRDM_K64F_Fusion/Generated_Code" "-IC:\\nxp\\KDS_3.2.0\\eclipse\\ProcessorExpert/Repositories/Kinetis_Repository/lib/Kinetis/pdd2/MK64FN1M0LL12/system" -std=gnu11 -c -o "Sources\\Application.o" "..\\Sources\\Application.c" 
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 "-I..\\Generated_Code" -I../Sources -I../Project_Settings/Startup_Code "-IC:\\nxp\\KDS_3.2.0\\eclipse\\ProcessorExpert/lib/Kinetis/iofiles" "-IC:\\nxp\\KDS_3.2.0\\eclipse\\ProcessorExpert/lib/Kinetis/pdd/inc" "-IC:/Users/Erich Styger/Data/HSLU/Vorlesung/nemesis/CCE/Eck/KDS/FRDM_K64F_Fusion/Sources" "-IC:/Users/Erich Styger/Data/HSLU/Vorlesung/nemesis/CCE/Eck/KDS/FRDM_K64F_Fusion/Generated_Code" "-IC:\\nxp\\KDS_3.2.0\\eclipse\\ProcessorExpert/Repositories/Kinetis_Repository/lib/Kinetis/pdd2/MK64FN1M0LL12/system" -std=gnu11 -c -o "Sources\\main.o" "..\\Sources\\main.c" 
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 "-I..\\Generated_Code" -I../Sources -I../Project_Settings/Startup_Code "-IC:\\nxp\\KDS_3.2.0\\eclipse\\ProcessorExpert/lib/Kinetis/iofiles" "-IC:\\nxp\\KDS_3.2.0\\eclipse\\ProcessorExpert/lib/Kinetis/pdd/inc" "-IC:/Users/Erich Styger/Data/HSLU/Vorlesung/nemesis/CCE/Eck/KDS/FRDM_K64F_Fusion/Sources" "-IC:/Users/Erich Styger/Data/HSLU/Vorlesung/nemesis/CCE/Eck/KDS/FRDM_K64F_Fusion/Generated_Code" "-IC:\\nxp\\KDS_3.2.0\\eclipse\\ProcessorExpert/Repositories/Kinetis_Repository/lib/Kinetis/pdd2/MK64FN1M0LL12/system" -std=gnu11 -c -o "Sources\\Shell.o" "..\\Sources\\Shell.c" 

09:55:48 Build Finished (took 987ms)

In the screenshots I’m using NXP Kinetis Design Studio v3.2.0 which is Eclipse Luna based, but things should apply to any other Eclipse distribution.

The menus to build and clean selected files is only available if ‘Build Automatically’ is *not* enabled:

Eclipse Build Automatically is disabled

Eclipse Build Automatically disabled

This is a workspace setting under Window > Preferences:

Build Automatically Workspace Setting

Build Automatically Workspace Setting

Troubleshooting

There has been (and still are?) some Eclipse CDT glitches around this. I have seen cases on my system that sometimes the ‘Clean Selected Files(s)’ and ‘Build Selected File(s)’ are still grayed out. In that case:

  1. Verify that ‘Build automatically’ is disabled, both in the Project menu and in the workspace preferences. Change the setting to make sure it gets written to the settings, then restart Eclipse.
  2. Try with a new workspace, first with a ‘new’ project, then import your existing project into that new workspace and try it out. If this works, then it is probably a setting in your old/existing workspace. If somehow only works with the new workspace, you probably should go with the new workspace and import your existing project into it. I had this issue with a workspace I carried through different Eclipse versions.
  3. Make sure you select only files you can build, e.g. not a *.h file.

Summary

Building or cleaning only a few files which I select is a nice feature. It only works if ‘build automatically’ is disabled.

Happy Building

Build (game engine) Eclipse

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Introducing Graph Concepts in Java With Eclipse JNoSQL
  • How to Build Real-Time BI Systems: Architecture, Code, and Best Practices
  • How To Build Resilient Microservices Using Circuit Breakers and Retries: A Developer’s Guide To Surviving
  • Accelerating Debugging in Integration Testing: An Efficient Search-Based Workflow for Impact Localization

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!