0

There is a legacy code which uses 'make' to build all C++ files. I am trying to decrease the number of files being included during build, that can create some space to add in some new code.(the new code is to set up serial communication). However, these files seems to be dependent on each other and I am having a hard time figuring out which ones to exclude from the build. The format of the makefile is as follows:

$(ObjDir)\a.obj:  w:\a.cpp
$(ObjDir)\b.obj:  w:\b.cpp
main_obj=\
    $(ObjDir)\a.obj\
    $(ObjDir)\b.obj
mainEXE.exe:$(main_obj)
    mainEXE.exe
    mainEXE.map

There is only one file I need to tamper with while adding the new lines of code. I am trying to keep only that particular file when build happens. Is there way I could figure out the dependencies?

theB
  • 6,450
  • 1
  • 28
  • 38
srao88
  • 1
  • 6
  • Can you try explaining what you are trying to do here more clearly? As written I can't understand your goal. (Also the recipe for `mainEXE.exe` in that snippet isn't correct what happened there?) Why are you trying to remove files from the build? – Etan Reisner Oct 08 '15 at 18:39
  • Thanks for your reply. I am trying to reduce the memory occupied by the executable. I want to avoid building all files as , when included they occupy a lot of memory and I am left with no space to add new code. I am trying to concentrate on the task to build one file for example a.cpp. I would like to know what files a.cpp is dependent on and build only those. I want to avoid building the complete project. – srao88 Oct 08 '15 at 21:59
  • What do you mean you have "no space to add new code"? Is this for a severely restricted embedded environment or something? According to that makefile snippet `a.obj` depends on `a.cpp` and `a.cpp` depends on nothing. – Etan Reisner Oct 08 '15 at 23:29
  • I am trying to modify a boot code – srao88 Oct 09 '15 at 00:47
  • @EtanReisner thanks for your last comment, i think i was able to figure out how dependencies work. was able to build the file. Really appreciate your help. :) – srao88 Oct 09 '15 at 00:53

0 Answers0