from makefile which i did not make it as a file
来源:互联网 发布:分层数据分析 编辑:程序博客网 时间:2024/06/06 05:04
it is very easy to start from google search engine that we can study a dozen of workable such files
key word makefile template there is very nice one from google doc
but it is not easy make non-innovation, non-creation non-new non-exciting things
note its better replace all indent with a tab
#
SAMPLE_NAME := lxi
SAMPLE_CSRC := $(wildcard *.c)
SAMPLE_CXXSRC := $(wildcard *.cpp)
SAMPLE_COBJS := ${SAMPLE_CSRC:.c=.o}
SAMPLE_CXXOBJS := ${SAMPLE_CXXSRC:.cpp=.o}
SAMPLE_OBJS := $(SAMPLE_CXXOBJS) $(SAMPLE_COBJS)
SAMPLE_INC_DIRS :=
SAMPLE_LIB_DIRS :=
SAMPLE_LIBS :=
###libcutils
CPPFLAGS += $(foreach includedir, $(SAMPLE_INC_DIRS),-I$(includedir))
LDFLAGS += $(foreach librarydir, $(SAMPLE_LIB_DIRS),-L$(librarydir))
LDFLAGS += $(foreach library, $(SAMPLE_LIBS),-l$(library))
CPPFLAGS += -std=c++0x -w -pthread -g
LDFLAGS += -lm
.PHONY: depend clean all distclean
all: $(SAMPLE_NAME)
@echo Simple compiler named something has been compiled
$(SAMPLE_MKDIRBIN)
mv ./$(SAMPLE_NAME) $(SAMPLE_BIN)
$(SAMPLE_NAME): $(SAMPLE_OBJS)
$(LINK.cc) $(SAMPLE_OBJS) -o $(SAMPLE_NAME)
SAMPLE_BIN := ../bin/
SAMPLE_MKDIRBIN := mkdir -p $(SAMPLE_BIN)
SAMPLE_OUT := ../out/
SAMPLE_MKDIROUT := mkdir -p $(SAMPLE_OUT)
clean:
@- $(RM) -f $(SAMPLE_NAME).tar.gz
@- $(RM) -rf $(SAMPLE_BIN)
@- $(RM) -rf $(SAMPLE_OUT)
@- $(RM) $(SAMPLE_NAME)
@- $(RM) $(SAMPLE_OBJS)
@- $(RM) *.d
distclean: clean
run: all
@echo Running test case....
$(SAMPLE_BIN)$(SAMPLE_NAME)
tarball: $(SAMPLE_NAME)
$(SAMPLE_MKDIROUT)
tar -czf ./* $(SAMPLE_NAME).tar.gz
disp:
@echo $(SAMPLE_OBJS)
define OBJECT_DEPENDS_ON_CORRESPONDING_HEADER
$(1) : ${1:.o=.h}
endef
$(foreach object_file,$(program_OBJS),$(eval $(call OBJECT_DEPENDS_ON_CORRESPONDING_HEADER,$(object_file))))
depend:
makedepend -- $(CPPFLAGS) $(CFLAGS) -- $(SAMPLE_CSRCS)
# Don't place anything below this line, since
# the make depend program will overwrite it
# DO NOT DELETE THIS LINE -- make depend depends on it.
- from makefile which i did not make it as a file
- NSLock释放时出现"unlocked from thread which did not lock it"错误
- I did an SDK update last night and it moved adb.exe. In its place it left a file called "adb_has_mov
- which it bills as co
- enum should not be used as an identifier since it is a reserved keyword from source level 1.5 on
- where i did not know?
- Why does Windows not recognize my USB device as the same device if I plug it into a different port?
- the makefile to make a directory into executable file
- windows安装python出现A program run as part of the setup did not finish as expected 的解决办法
- How do I select a random line from a file?
- Lessons from Leaders: How JBoss did it
- The packaging for this project did not assign a file to the build artifact
- The packaging for this project did not assign a file to the build artifact
- UVa 11222 - Only I did it!
- UVA - 11222 Only I did it!
- fatal:pathspec did not match any file
- Share a peice of movie script from Rocky Ⅵ which I love the most.
- The content of the adapter has changed but ListView did not receive a notification make sure the con
- PHP上传文件
- Java之GUI编程
- 二叉树的性质
- SQL Server2005 异常处理机制(Begin try Begin Catch)
- UVA 1399 - Puzzle(AC自动机+DP)
- from makefile which i did not make it as a file
- openGL学习笔记3
- 磁盘与文件系统
- Access restriction: The type * is not accessible due to restrict,报错问题,只试过第二种,OK。
- HDU-4968 Improving the GPA 暴力枚举
- (leetcode)Linked List Cycle
- list add方法
- 如何培养孩子主动学习兴趣
- OpenERP Server Developers Documentation之Form Views Guidelines(表单视图参考)