如今編譯方案都偏心使用cmake解決問題,這兩條作unity插件,仍是用Makefile,竟然忘得光光,好記性不如爛筆頭。linux
後面,翻箱倒櫃找到之前爲鍊金術寫的Makefiel,發現還真是挺好用,貼出來,當萬能Makefile模板挺好的。。c++
PROJECT_DIR = .. #PATH:=${ALCHEMY_HOME}/achacks:${PATH} CC = gcc AR = ar CFLAGS := -Wall -W -std=gnu99 -g LDFLAGS = INCLUDE_DIR = -I$(PROJECT_DIR)/luajit/src LIBNAME = libz.a OBJS = $(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)
另外,也改善一下對MinGW的印象,其實也挺好用的,不必定要用cmake生成vc解決方案,既然喜歡linux,爲何不能接受mingw呢?bash