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

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

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

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Simplify NoSQL Database Integration in Java With Eclipse JNoSQL 1.1.3
  • Domain-Driven Design: Manage Data With Jakarta Data and JNoSQL
  • MLOps: How to Build a Toolkit to Boost AI Project Performance
  • Snowflake Empowers Developers to Easily Build Data-Driven Apps and Chatbots

Trending

  • Is Agile Right for Every Project? When To Use It and When To Avoid It
  • The 4 R’s of Pipeline Reliability: Designing Data Systems That Last
  • Comprehensive Guide to Property-Based Testing in Go: Principles and Implementation
  • Unlocking AI Coding Assistants Part 2: Generating Code
  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

  • Simplify NoSQL Database Integration in Java With Eclipse JNoSQL 1.1.3
  • Domain-Driven Design: Manage Data With Jakarta Data and JNoSQL
  • MLOps: How to Build a Toolkit to Boost AI Project Performance
  • Snowflake Empowers Developers to Easily Build Data-Driven Apps and Chatbots

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!