0
# Baseando-se no link: https://www.embarcados.com.br/introducao-ao-makefile/
all: bancoBPE
bancoBPE: main.o
gcc -o bancoBPE main.o -Wall -Wextra -Werror -Wpedantic
# Não sei direito como compilar esse structs.h sozinho sem ter structs.c
structs.o: structs.h
gcc -o filacirc.o filacirc.c -Wall -Wextra -Werror -Wpedantic
filacirc.o: filacirc.c filacirc.h
gcc -o filacirc.o filacirc.c -Wall -Wextra -Werror -Wpedantic
pilhaseq.o: pilhaseq.c pilhaseq.h
gcc -o pilhaseq.o pilhaseq.c -Wall -Wextra -Werror -Wpedantic
lista.o: lista.c lista.h
gcc -o lista.o lista.c -Wall -Wextra -Werror -Wpedantic
clean:
rm -rf *.o *~ bancoBPE
The following terminal error occurred:
$ make
gcc -o bancoBPE main.o -Wall -Wextra -Werror -Wpedantic
/usr/bin/ld: main.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
makefile:5: recipe for target 'bancoBPE' failed
make: *** [bancoBPE] Error 1
If someone could pass on some material so I can study better, I’d appreciate it. I’m trying to understand how Makefile works, but still not very successful despite reading some references.