Skip to content

Compile and Assemble from multiple source file #122

@FourcadeL

Description

@FourcadeL

Hi,
First, I want to thank you for the work you do on HuC, I think this is the most complete and thorough groupment of tools and documentation for PCE development :)

As I understand, huc / hucc are not made for linking objects files nor compiling from distinct *.c files and the cleanest way would be to use #include "other.c" in the main source file.

From what I could test huc / hucc can take multiple .c files as input but does not propagate #define directives from one file to the next.
As a result, the following example :
defs.h

#ifndef DEFS_H
#define DEFS_H
unsigned char example;
#endif

main.c

#include <huc.h>
#include "defs.h"

void main() {
   // some code
}

other.c

#include <huc.h>
#include "defs.h"

// some routines

results in
hucc -s main.c other.c
defining the _example label multiple time.

Should the propagation of labels be implemented when invoking from multiple sources ?
Or is there a need to add a "--no-labels-exports" directive for example so that .c files could be compiled separately and then assembled with PCEAS without multiple definitions ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions