$project
|
+------------+----------------+----------------+
| | | |
gestore/ tipoA/ tipoB/ shared/
| | | |
+ + + +
| | | +--------|------------------+
gestore.c tipoA.c tipoB.c/ funzioni.c/.h sem.c/.h gF.c./
こんにちはを反復処理メイクファイルを作成し、私はこれらのコマンドを実行し、このプロジェクトのためのメイクファイルを作成したいですtipoA FOLDER:tipoBフォルダにディレクトリ
gcc -o tipoA tipoA.c ../shared/funzioni ../shared/sem ../shared/gestioneFile
ステップ3:
gestoreフォルダにgcc -o tipoB tipoB.c ../shared/funzioni ../shared/sem ../shared/gestioneFile
ステップ4:
gcc -o gestore gestore.c ../shared/funzioni ../shared/sem ../shared/gestioneFile
./gestore
これは私のメイクですが、それがない作品行います
#Makefile
cc=gcc
./gestore/gestore: ./shared/gestioneFile.o ./shared/sem.o ./shared/funzioni.o ./tipoA/tipoA.o ./tipoB/tipoB.o ./gestore/gestore.o
./gestore/gestore
./shared/gestioneFile.o:
cc -c -o ./shared/gestioneFile ./shared/gestioneFile.c
./shared/sem.o:
cc -c -o ./shared/sem ./shared/sem.c
./shared/functions.o:
cc -c -o ./shared/funzioni ./shared/funzioni.c
./tipoA/tipoA.o: ./shared/gestioneFile.o ./shared/sem.o ./shared/funzioni.o
cc -o ./tipoA/tipoA ./tipoA/tipoA.c ./shared/funzioni ./shared/sem ./shared/gestioneFile
./tipoB/tipoB.o: ./shared/gestioneFile.o ./shared/sem.o ./shared/funzioni.o
cc -o ./tipoB/tipoB ./tipoB/tipoB.c ../shared/funzioni ../shared/sem ../shared/gestioneFile
./gestore/gestore.o: ./shared/gestioneFile.o ./shared/sem.o ./shared/funzioni.o
cc -o ./gestore/gestore ./gestore/gestore.c ./shared/funzioni ./shared/sem ./shared/gestioneFile
EDIT: @HardcoreHenryこれが今の私のメイクですが、それが与えるをエラー:*****見つからないセパレータ**
#Makefile
cc=gcc
./gestore/gestore: ./shared/gestioneFile.o ./shared/sem.o ./shared/funzioni.o ./tipoA/tipoA.o ./tipoB/tipoB.o ./gestore/gestore.o
./gestore/gestore
./shared/gestioneFile.o:
cc -c -o ./shared/gestioneFile.o ./shared/gestioneFile.c
./shared/sem.o:
cc -c -o ./shared/sem.o ./shared/sem.c
./shared/funzioni.o:
cc -c -o ./shared/funzioni.o ./shared/funzioni.c
./tipoA/tipoA.o: ./shared/gestioneFile.o ./shared/sem.o ./shared/funzioni.o
cc -o ./tipoA/tipoA.o ./tipoA/tipoA.c ./shared/funzioni.o ./shared/sem.o ./shared/gestioneFile.o
./tipoB/tipoB.o: ./shared/gestioneFile.o ./shared/sem.o ./shared/funzioni.o
cc -o ./tipoB/tipoB.o ./tipoB/tipoB.c ../shared/funzioni.o ../shared/sem.o ../shared/gestioneFile.o
./gestore/gestore.o: ./shared/gestioneFile.o ./shared/sem.o ./shared/funzioni.o
cc -o ./gestore/gestore.o ./gestore/gestore.c ./shared/funzioni.o ./shared/sem.o ./shared/gestioneFile.o
SOLVED(たとえE最初のルールは)ファイルを実行しません:
./gestore/gestore: ./shared/gestioneFile.o ./shared/sem.o ./shared/funzioni.o ./tipoA/tipoA ./tipoB/tipoB ./gestore/gestore
./gestore/gestore
./shared/gestioneFile.o:
gcc -c -o ./shared/gestioneFile ./shared/gestioneFile.c
./shared/sem.o:
gcc -c -o ./shared/sem ./shared/sem.c
./shared/funzioni.o:
gcc -c -o ./shared/funzioni ./shared/funzioni.c
./tipoA/tipoA: ./shared/gestioneFile.o ./shared/sem.o ./shared/funzioni.o
gcc -o ./tipoA/tipoA ./tipoA/tipoA.c ./shared/gestioneFile ./shared/sem ./shared/funzioni
./tipoB/tipoB: ./shared/gestioneFile.o ./shared/sem.o ./shared/funzioni.o
gcc -o ./tipoB/tipoB ./tipoB/tipoB.c ./shared/gestioneFile ./shared/sem ./shared/funzioni
./gestore/gestore: ./shared/gestioneFile.o ./shared/sem.o ./shared/funzioni.o
gcc -o ./gestore/gestore ./gestore/gestore.c ./shared/gestioneFile ./shared/sem ./shared/funzioni
。あなたの質問の最も重要かつ重要な部分 - どのようにMakefileが機能しないのですか?詳細を与える! –
この行( 'cc = gcc')は途中で何もしません。おそらく 'CC = gcc'を意味するかもしれませんが、他の場所で' cc'ではなく '$(CC)'を使用していたでしょう –
'-o 'オプションの拡張子がないようです: ' cc - c -o ./shared/sem。/ shared/sem.c'は 'cc -c -o ./shared/sem.o。/ shared/sem.c'になります。 – Nonyme