Slookeur / Atomes

atomes: codeblocks dev files
GNU Affero General Public License v3.0
8 stars 1 forks source link

Weirdness in make targets #7

Closed fxcoudert closed 2 years ago

fxcoudert commented 2 years ago

After I compile, I see that make has created some weirdly named files:

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    "-DPACKAGE_DATA_DIR=\"\""
    -O0
    -O3

I think they are created because of these rules in Makefile:

$(OBJ)gtk-misc.o:
        $(CC) -c -MT $(OBJ)gtk-misc.o -MD -MP -MF $(CPPFLAGS) $(CFLAGS) $(DEFS) -o $(OBJ)gtk-misc.o $(GUI)gtk-misc.c $(INCLUDES)

and

$(OBJ)global.o:
        $(CC) -c -MT $(OBJ)global.o -MD -MP -MF $(CFLAGS) $(DEFS) -o $(OBJ)global.o $(SRC)global.c $(INCLUDES)

The -M options output dependency rules, but I am not sure if they are actually used. But, the -MF option is supposed to specify the file where the rules are written, and because it's used as -MF $(CPPFLAGS) or -MF $(CFLAGS), then it creates a file that is named as the first flag of CPPFLAGS (in my case, -DPACKAGE_DATA_DIR=\"\") or CFLAGS (in my case, -O3 or -O0).

This is made worse by the fact that this first flag, treated as a file named, is not actually used by the compiler as a flag.

Slookeur commented 2 years ago

To be honest I probably go all those rules for work done long ago, probably not even done the right way, then I just let it go 'cause I am not fluent enough in compiling, and also, and most of all, because my attention was focused somewhere else ;-) I really appreciate you cleaning my mess !