当前位置: 技术问答>linux和unix
Solaris下的Makefile问题
来源: 互联网 发布时间:2015-03-15
本文导语: CC = cc RM = -rm SOURCE = $(HOME)/c++/src INCLUDE = $(HOME)/c++/include LIB = $(HOME)/c++/lib BIN = $(HOME)/c++/bin CFLAGS = -O -w2 -s vpath %.h $(INCLUDE) vpath %.c $(SOURCE) all: $(BIN)/hello OBJECTS = $(patsubst %.c,%.o, $(wildcard *.c )) $(BIN)/hello...
CC = cc
RM = -rm
SOURCE = $(HOME)/c++/src
INCLUDE = $(HOME)/c++/include
LIB = $(HOME)/c++/lib
BIN = $(HOME)/c++/bin
CFLAGS = -O -w2 -s
vpath %.h $(INCLUDE)
vpath %.c $(SOURCE)
all: $(BIN)/hello
OBJECTS = $(patsubst %.c,%.o, $(wildcard *.c ))
$(BIN)/hello: $(OBJECTS)
$(CC) -o $(BIN)/hello $(OBJECTS)
.PHONY: clean
clean:
$(RM) $(SOURCE)/$(OBJECTS)
run:
-$(BIN)/hello
我在vpath那有错误,说是“unexcepted end of line seen”
还有如果在OBJECTS = $(patsubst %.c,%.o, $(wildcard *.c ))这里把"="换为":="的话也有这个错误,如果用"="的话我发现其实OBJECTS里面是空的,啥也没有
怎么回事?
Sun OS Version:5.7
RM = -rm
SOURCE = $(HOME)/c++/src
INCLUDE = $(HOME)/c++/include
LIB = $(HOME)/c++/lib
BIN = $(HOME)/c++/bin
CFLAGS = -O -w2 -s
vpath %.h $(INCLUDE)
vpath %.c $(SOURCE)
all: $(BIN)/hello
OBJECTS = $(patsubst %.c,%.o, $(wildcard *.c ))
$(BIN)/hello: $(OBJECTS)
$(CC) -o $(BIN)/hello $(OBJECTS)
.PHONY: clean
clean:
$(RM) $(SOURCE)/$(OBJECTS)
run:
-$(BIN)/hello
我在vpath那有错误,说是“unexcepted end of line seen”
还有如果在OBJECTS = $(patsubst %.c,%.o, $(wildcard *.c ))这里把"="换为":="的话也有这个错误,如果用"="的话我发现其实OBJECTS里面是空的,啥也没有
怎么回事?
Sun OS Version:5.7
|
我在vpath那有错误,说是“unexcepted end of line seen”
在文件后面加个回车
在文件后面加个回车