A lot of the documentation and tutorials seem to be out of date. Not quite sure how to do it.
I tried just setting the target:
const target = b.standardTargetOptions(.{ .default_target = .{ .ofmt = .c } });
and it does indeed build a C file at zig-out/bin/main.c. However, trying to build it with zig cc ./* gives me an error:
./zig.h:1762:26: error: use of undeclared identifier 'ZIG_TARGET_MAX_INT_ALIGNMENT'
1762 | uint16_t alignment = ZIG_TARGET_MAX_INT_ALIGNMENT;
| ^
1 error generated.
./france.c:7348:2: error: non-ASM statement in naked function is not supported
7348 | goto zig_block_0;
| ^
./france.c:7342:1: note: attribute is here
7342 | zig_naked zig_noreturn void start__start__124(void) {
| ^
./zig.h:84:34: note: expanded from macro 'zig_naked'
84 | #define zig_naked __attribute__((naked))
Not quite sure what's the current standard for doing this