mikesart / inotify-info

Linux inotify info reporting app
MIT License
280 stars 29 forks source link

Makefile: cleanup build system #42

Closed intelfx closed 4 months ago

intelfx commented 4 months ago

Allow overriding the "general purpose" (performance, debugging, hardening) flags in $(CFLAGS), $(CXXFLAGS) and $(LDFLAGS) while at the same time ensuring they always contain the "functionally required" flags (C/C++ standard conformance, diagnostics and preprocessor definitions).


This e.g. makes it possible to build inotify-info with

$ make CFLAGS=-O2 CXXFLAGS=-O2

Where -O2 overrides the instruction set, optimization level and debugging information generation flags (as might be the distro policy), while keeping the necessary flags such as -std=... and -D... intact.

motiejus commented 4 months ago

Thanks! I just realized I have packaged this to NixOS with -march=native.

motiejus commented 4 months ago

I think we should get rid of -march=native and leave it to the callers. Can you review https://github.com/mikesart/inotify-info/pull/44 ?