compiling the same C++ file in several ways
Basile Starynkevitch <[email protected]> Sun, 28 Sep 2025 11:57:43 +0200
| Newsgroups | gmane.comp.gnu.make.general |
|---|---|
| Message-ID | <[email protected]> |
Hello,
In the RefPerSys inference engine project (GPL licensed, not yet GNU) on gi=
thub below=20
which I compile on a Debian computer=20
I have a few dozens of C++ files (some of them generated by the software it=
self).
I am using GNU make 4.4.1 (-with guile enabled-) on Linux/Debian/x86-64
The C++ compiler is GCC 15 or even a recent GCC 16 snapshot=C2=A0 (installe=
d by me as /usr/local/bin/g++-trunk)
(GCC trunk successfully compiled by me, long time ago I did contribute to G=
CC https://arxiv.org/abs/1109.0779 ...)
I am referring to commit https://github.com/RefPerSys/RefPerSys/commit/e01f=
0e64c402f97ff0d84bbcf269bf353cf7ba89
(if you want to help me, look into its GNUmakefile probably lines 160-200)
I would like to compile a given C++ file, for example agenda_rps.cc, in sev=
eral (currently two) different ways:
agenda_rps.o is successfule compiled from agenda_rps.cc, and GNU make runs
/usr/local/bin/g++-trunk -std=3Dgnu++2c -I/usr/local/include -Og -g -fPIC -=
Wall -Wextra -g2 -Wall -Wextra -Wnull-dereference \
-MD -MFMake-dependencies/__agenda_rps.mkdep \
-I/usr/include/jsoncpp \
\
-DRPS_THIS_SOURCE=3D\"agenda_rps.cc\" -DRPS_GITID=3D\"55d787=
797365d17dd546ee3a14e16aaaec7aec44\" \
-DRPS_SHORTGITID=3D\"55d787797365\" \
-DRPS_BASENAME=3D\"agenda_rps\" \
-DRPS_HOST=3D\"rimski.lesours\" \
-DRPS_ARCH=3D\"x86_64\" -DRPS_HAS_ARCH_x86_64 \
-DRPS_OPERSYS=3D\"GNU_Linux\" -DRPS_HAS_OPERSYS_GNU_Linux \
-c -o agenda_rps.o agenda_rps.cc
I would like to compile agenda_rps.raw.o from the same agenda_rps.cc but p=
assing in addition -DRPS_WITH_FLTK=3D0 -DRPS_IS_RAW=3D1=20
Any help or example of open source GNUmakefile doing so is welcome
Thanks.
NB: I want to avoid GNU autoconf or cmake, not being familiar with them
--=20
Basile STARYNKEVITCH <[email protected]>
8 rue de la Fa=C3=AFencerie http://starynkevitch.net/=
Basile/ =20
92340 Bourg-la-Reine https://github.com/bstarynk
France https://github.com/RefPerSys/RefPerSy=
s