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