# Compile One project for al least 3 modules

**URL:** <https://forum.legato.io/t/compile-one-project-for-al-least-3-modules/5837>\
**Category:** Legato Application Framework\
**Created:** [June 14, 2021, 10:51am UTC](https://forum.legato.io/t/compile-one-project-for-al-least-3-modules/5837 "2021-06-14T10:51:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luis](https://avatars.discourse-cdn.com/v4/letter/l/3e96dc/32.png) [@Luis](https://forum.legato.io/u/Luis)\
**Post date:** [June 14, 2021, 10:51am UTC](https://forum.legato.io/t/compile-one-project-for-al-least-3-modules/5837/1 "2021-06-14T10:51:13Z")

</div>

We have developed a projet for module WP8548. But now we must change to WP7607 and WP7611. There are some hardware, device mapping …etc differences.

I dont want to have a different projet for each module. So I started defining in app.adef some “envVars” to be able to manage some parts of the code. For example MODULE==WP8548.

But I have realised that adef “envVArs” is not what I really need. Can I define a global compiler MACRO like:  
#define MODULE WP8548  
//#define MODULE WP7607  
and use it inside c files, cdef files and also adef files?

What is the best aproach to do something similar?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [June 14, 2021, 10:57am UTC](https://forum.legato.io/t/compile-one-project-for-al-least-3-modules/5837/2 "2021-06-14T10:57:08Z")

</div>

seems cannot, probably you need to use different .adef file.

> [@Can I use the executables section in .adef to create distinct executable names?](https://forum.legato.io/t/can-i-use-the-executables-section-in-adef-to-create-distinct-executable-names/3528/3):
>
> Hi @daav, I understand your explanation, but, I can’t find the exact syntax to concatenate the environment variable to the name of my application. The compiler complains about the $ symbol. I already tried some other tricks and other character symbols, but, nothing compiles. I didn’t find any examples in the documentation. Can you help me out, please? Greetings, annaertd

---

<div class="post-metadata">

**Author:** ![Luis](https://avatars.discourse-cdn.com/v4/letter/l/3e96dc/32.png) [@Luis](https://forum.legato.io/u/Luis)\
**Post date:** [June 14, 2021, 11:09am UTC](https://forum.legato.io/t/compile-one-project-for-al-least-3-modules/5837/3 "2021-06-14T11:09:03Z")

</div>

Lots of thanks!!. Then I’ll continue using the “envVars” section and then commenting some parts.
