Update old post about using C headers in ASM

This commit is contained in:
Thomas Lovén 2016-11-01 14:19:02 +01:00
parent 62cc2f2eb8
commit b20795b941

View File

@ -3,6 +3,18 @@ title: "C headers in Asm"
subtitle: "Cleaning up the build chain"
tags: [osdev]
> **NOTE (2016-11-01)**
>
> Since people are apparently still finding this page four years later (yay! Cool URLs don't change!): I've since found a better and more correct way of doing this.
>
> If you're compiling using `gcc`, you can just name your assembly files (with includes and macros and stuff) `whatever.S` (capital S), and compile them right down to `whatever.o` as you normally would (using `gcc`, not `as`).
>
> GNU make also has a builtin rule that does this automatically... yeah...
>
> From this I've learned the following
> - Trust make. It's terribly powerful if you trust it to be.
> - GCC is not the GNU C Compiler. It's the GNU Compiler Collection.
Something that always annoyed me is how hard it is to synchronize constants
between assembly and c code. In assembler, you define a constant value as