fluid-cloudnative / fluid

Fluid, elastic data abstraction and acceleration for BigData/AI applications in cloud. (Project under CNCF)
https://fluid-cloudnative.github.io/
Apache License 2.0
1.63k stars 957 forks source link

[ENHANCEMENT] Proposal for Enhancing Makefile Optimization #4297

Open Syspretor opened 3 weeks ago

Syspretor commented 3 weeks ago

Hello everyone,

I've been working with our Makefile and I noticed that there are several areas where we can improve its structure and functionality. Optimizing the Makefile can lead to better maintainability, faster builds, and improved clarity for new contributors.

Here are a few best practices I believe we could implement:

  1. Use of Variables: Defining variables for compiler flags, directories, and sources can simplify edits and enhance readability.

  2. Phony Targets: Adding .PHONY for non-file targets helps avoid conflicts with files of the same name.

    .PHONY: all clean
  3. Automatic Dependency Generation: This can help manage header files automatically, ensuring the correct recompilation of files as needed.

  4. Modularization: Breaking down the Makefile into multiple smaller files if it gets too complex will help keep things organized.

  5. Improved Clean Targets: Including more thorough clean up options to ensure no residual files are left behind.

I would love to hear from others about their experiences and thoughts on these proposals. If anyone is interested, we could collaborate on updating the Makefile together!

References GNU Make Manual Makefile Best Practices

omerap12 commented 2 weeks ago

I would glad to help :)

Syspretor commented 2 weeks ago

Thanks for your help! @omerap12 I hope that before we actually start coding, we can identify a few specific directions for optimizing the makefile. Later, I will summarize some directions. If you have any suggestions, please feel free to bring them up, and let’s see which ones you are interested in.

Syspretor commented 2 weeks ago

/assign @omerap12

omerap12 commented 2 weeks ago

Sounds good, @Syspretor . Keep me posted :)