分享一个Makefile模板

LINK    = @echo linking $@ && arm-linux-gnueabihf-g++
GCC     = @echo compiling $@ && arm-linux-gnueabihf-g++ 
GC      = @echo compiling $@ && arm-linux-gnueabihf-gcc
AR      = @echo generating static library $@ && ar crv 
FLAGS   = -g -DDEBUG -W -Wall -fPIC
GCCFLAGS = 
DEFINES = 
HEADER  = -I./ -I/usr/arm/include
LIBS    = -L./ -L/usr/arm/lib
LINKFLAGS =

LIBS    += -pthread -lcrypto -lssl -lcurl -lqiniu -lm

SOURCE_FILES :=\
		main.cpp\
		app/qiniu/qiniu.cpp\

PROJECTNAME = FireDevice.out

TARGET = main

all: $(SOURCE_FILES)
	$(LINK) $(FLAGS) $(LINKFLAGS)  -o ${PROJECTNAME} $^ $(LIBS) ${HEADER}
clean:
	rm -rf *.o ${PROJECTNAME}

  

posted @ 2021-08-05 16:14  流逝的轻风  阅读(24)  评论(0编辑  收藏  举报