I have Makefile in Ubuntu12.10 as below
. 当我通过 make 命令运行它时,它显示为 g++ -c -o myprog1.o myprog1.cpp
似乎变量 CFLAGS 和 CINCLUDE 不起作用。
任何人都可以帮我检查一下吗?
谢谢,
RM = rm -f
CC = gcc
AR = ar rc
CFLAGS= -Wall -g -O2 -std=c++11 -fPIC
CINCLUDE= -I. -I../include
OBJECTS= myprog1.o myprog2.o
STATIC_LIB = libctest.a
$(STATIC_LIB): $(OBJECTS)
$(AR) $(STATIC_LIB) $(OBJECTS)
%.o : %.c
$(CC) -c $(CFLAGS) $(CINCLUDE) $< -o $@
clean:
$(RM) $(OBJECTS)
$(RM) $(STATIC_LIB)