# 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 error occurred in the terminal:
$ 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 can pass on material so that I can study better, I would appreciate it. I'm trying to understand right how the makefile works, but still not much success despite reading some references.