今天春天
今天春天

Reputation: 993

GCC: mixed C/assembly project - include directive

I have a huge project consisting of:

abc.S has all the files included like this:

.include "a1.S"
.include "a2.S"
.include "a3.S"

Now I want to include a file called definitions.h which contains some define MEOW 123 and I want to use MEOW in e.g. a1.S - how does my makefile have to look like to achieve this behaviour? Where do I have to include definitions.h?

I tried a few things but ended up having nothing but errors.

Upvotes: 2

Views: 103

Answers (1)

今天春天
今天春天

Reputation: 993

Figured it out for myself - makefile could look like this:

all:
            gcc -o abc a1.S a2.S a3.S abc.S main.c
clean:
            rm -rf abc

Include definitions.h in a1.S and include a1.S in abc.S.

Upvotes: 1

Related Questions