11

I am new to CDT and I am trying to generate the makefile automatically. I notice that it include three files that doesn't exist at all, makefile.init, makefile.defs, makefile.targets. Just wondering, what do they do? and why are they there?

################################################################################
# Automatically-generated file. Do not edit!
################################################################################

-include ../makefile.init

RM := rm -rf

# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include objects.mk

#Other codes

-include ../makefile.defs

# Add inputs and outputs from these tool invocations to the build variables 

#Other codes

-include ../makefile.targets
Steven
  • 475
  • 4
  • 14

1 Answers1

11

The three includes are intended for your sake. If you need to compile something proprietary manually, or copy files or anything you can come up with before the main program is compiled, you create the file makefile.init in the source directory and put your makefile-stuff in here.

The same applies to the other files just at other times in the compile chain.

  • The Java class used seems to be `GnuMakefileGenerator`. It would be nice if variables were exported for use by the user make extentions (like `CC=`, etc.) It would allow for [two-phase linking for signing images](https://stackoverflow.com/questions/24150030/storing-crc-into-an-axf-elf-file). – artless noise Jun 10 '22 at 14:17