Easy to use General makefile template

Source: Internet
Author: User

Now the compiler is favored to use cmake to solve the problem, the two do Unity plug-ins, or with makefile, incredibly forget the light, good memory is not as bad as written.

Back, rummaging to find previously for alchemy written Makefiel, found it is very useful, posted out, when the Universal makefile template is very good.

Project_dir =.. #PATH: =${alchemy_home}/achacks:${path}cc = Gccar = arcflags: =-wall-w-std=gnu99-gldflags = Include_dir =-I$ (PROJECT_D IR)/luajit/srclibname = LIBZ.AOBJS = $ (patsubst./%.C,%.o,$ (wildcard./*.c)). Phony:all clean. Suffixes:. C. o.c.o:$ (CC) $ (CFLAGS)-C $< $ (include_dir) All: $ (libname) $ (libname): $ (OBJS) @$ (AR) RCS $ (libname) $ (objs ) Ranlib $ (libname) Clean: @rm-RF $ (libname) $ (OBJS)
    • Modify libname for you want the library name
    • The source directory file is named makefile
    • Enable and make clean only
    • If C + + 's own implementation of the automatic derivation rules, it is easy to see

In addition, also improve the impression of MinGW, in fact, it is very useful, not necessarily to use CMake VC solution, since like Linux, why can not accept mingw it?

Easy to use General makefile template

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.