我正在嘗試構建Atmel BitCloud v3.2示例應用程序在Linux和Mac中與makefile閃爍。在Windows中一切正常。但是在類似Posix的系統中,以下行不起作用:Makefile規則未在Linux中執行
all: directories images root_files size
$(OBJ_PATH)/%.o: $(SRCS)
$(CC) $(CFLAGS) $(filter %/$(subst .o,.c,$(notdir [email protected])), $(SRCS)) -o [email protected]
因此,編譯器未被執行且目標文件未被創建。其結果是接頭顯示錯誤消息,例如
avr-gcc: error: All_MegaRf_Atmega256rfr2_8Mhz_Gcc/Obj/blink.o: No such file or directory
線$(OBJ_PATH)/%.o: $(SRCS)
是問題的根源。
如果我用$(OBJ_PATH)/blink.o: ../../src/blink.c
這樣的黑色替換它,則相應的對象文件正在成功創建。
我甚至能夠通過手動設置構建目標如下構建整個應用程序:
$(OBJ_PATH)/blink.o: ../../src/blink.c
$(CC) $(CFLAGS) $(filter %/$(subst .o,.c,$(notdir [email protected])), $(SRCS)) -o [email protected]
$(OBJ_PATH)/stdPdsEvents.o: ../../../../BitCloud/Components/PersistDataServer/std/src/stdPdsEvents.c
$(CC) $(CFLAGS) $(filter %/$(subst .o,.c,$(notdir [email protected])), $(SRCS)) -o [email protected]
在項目的所有.c文件。
的,另一方面源列表的定義如下:
SRCS = \
../../src/blink.c \
../../../../BitCloud/Components/PersistDataServer/std/src/stdPdsMemAccess.c \
../../../../BitCloud/Components/PersistDataServer/std/src/stdPdsTimer.c \
誰能幫我弄清楚爲什麼是模式匹配不工作,如何恢復它。
注:類似的話題已經被打開here,但筆者次找到了自己的解決方案並沒有在我看來很好地解釋,所以我沒能解決我的問題。
@MichaëlAzevedo:你最近的編輯似乎已經刪除了語義上重要的空白。請不要使用您不熟悉的語言編輯代碼。謝謝。 – tripleee
@tripleee我的壞,我試圖通過代碼縮進來替換揹包逃脫。我應該回到前一個嗎? –
@MichaëlAzevedo不需要;我已經恢復了丟失的標籤。感謝您做出如此快速的迴應。 – tripleee