一个简单的makefile

时间:2021-05-20 23:52:14

#common makefile header

LOCAL_INCLUDE := \
-I/xxx/ACE/ACE/

LOCAL_FLAGS := $(LOCAL_INCLUDE)

LIBS := -L/xxx/ACE/ACE -lACE

CCC :=/usr/bin/g++
CC :=/usr/bin/gcc
AR :=/usr/bin/ar -r

OBJS = test.o
TARGET = test
RM = rm -f

$(TARGET):$(OBJS)
$(CCC) -o $(TARGET) $(OBJS) $(LOCAL_FLAGS) $(LIBS)

$(OBJS):%o:%cpp
$(CCC) -c $(CFLAGS) $< -o $@ $(LOCAL_FLAGS) $(LIBS)

clean:
$(RM) $(TARGET) $(OBJS)