Reputation: 993
I have a huge project consisting of:
main.c
which contains main function and calls function from abc.S
- nothing more!abc.S
which does some initialization steps and then calls other assembly routinesa1.S
, a2.S
, ... which contain functions called by abc.S
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
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