Makefile
- Added `-c` to ONLY compile but do NOT attempt to link and make an executable. If we try this it looks for a `main` symbol to satisfy the `_start` for linux-ld - Updated the build instructions for being able to statically link against the library
This commit is contained in:
parent
9c72115dc1
commit
513fb920ce
|
@ -1,9 +1,9 @@
|
||||||
library:
|
library:
|
||||||
gcc library.c -shared -o library.o
|
gcc -c library.c -o library.o
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm library.o
|
rm library.o
|
||||||
rm main
|
rm main
|
||||||
|
|
||||||
main:
|
main:
|
||||||
gcc main.c library.o -o main
|
gcc main.c library.o -o main
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
int myFunc(int x)
|
int myFunc(int x)
|
||||||
{
|
{
|
||||||
return x*2;
|
return x*4;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue