寫了個巢狀執行make
跟我一起寫 Makefile ------------------------------陳皓
#VPATH = BaseRender:shaderUtil:testApp:glad:.
PROJECT_PATH = $(shell pwd)
OBJSDIR = $(PROJECT_PATH)/objs
CFLAGS = -O2 -lstdc++
DIRS = BaseRender shaderUtil testApp glad.
FILES = $(foreach dir, $(DIRS), $(wildcard $(dir)/*.cpp))
OBJS = $(patsubst %.cpp, %.o, $(FILES))
LIBS += -lGLEW -lglfw -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo
TARGET = tutorialEdit
all:$(TARGET)
$(TARGET):$(OBJSDIR) winMain.o
$(MAKE) -C BaseRender
$(MAKE) -C shaderUtil
$(MAKE) -C utils
$(MAKE) -C glad
$(MAKE) -C testApp
$(CC) $(CFLAGS) $(LIBS) $(OBJSDIR)/*.o -o
$(OBJSDIR):
mkdir -p [email protected]
winMain.o:%.o:%.cpp
$(CC) -c $< -o $(OBJSDIR)/[email protected] $(CFLAGS) -IBaseRender -IshaderUtil -Iutils -ItestApp -Iglad
.PHONY:clean
clean :
-$(RM) $(TARGET) $(OBJSDIR)/*.o
這個makefile仍然有問題,巢狀執行的makefile裡面出現警告