ID photo of Ciro Santilli taken in 2013 right eyeCiro Santilli OurBigBook logoOurBigBook.com  Sponsor 中国独裁统治 China Dictatorship 新疆改造中心、六四事件、法轮功、郝海东、709大抓捕、2015巴拿马文件 邓家贵、低端人口、西藏骚乱
c/Makefile
.POSIX:

# Input parameters
CC = gcc
CFLGS = -ggdb3 -O$O -pedantic-errors -std=c11 -Wall -Wextra
IN_EXT = .c
O = 0
OUT_DIR = .
OUT_EXT = .out

-include Makefile_params

OUTS = $(addprefix $(OUT_DIR)/, $(addsuffix $(OUT_EXT), $(basename $(wildcard *$(IN_EXT)))))

.PHONY: all clean mkdir test

all: mkdir $(OUTS)

$(OUT_DIR)/%$(OUT_EXT): %$(IN_EXT)
	$(CC) $(CFLGS) -o '$@' '$<' $(LIBS)

$(OUT_DIR)%$(OUT_EXT): $(IN_DIR)%$(CXX_EXT) $(ALL_DEPEND)
	$(CXX) $(CXXFLAGS) -o '$@' '$<' $(LIBS)

$(OUT_DIR)%$(OUT_EXT): $(IN_DIR)%$(FF_EXT) $(ALL_DEPEND)
	$(FF) $(FFLAGS) -o '$@' '$<' $(FFLIBS)

clean:
	if [ '$(OUT_DIR)' = '.' ]; then \
	  rm -f *'$(OUT_EXT)'; \
	else \
	  rm -rf '$(OUT_DIR)'; \
	fi

mkdir:
	mkdir -p '$(OUT_DIR)'

test: all
	@\
	for t in *"$(OUT_EXT)"; do\
	  if ! ./"$$t"; then\
		echo "ASSERT FAILED: $$t";\
		exit 1;\
	  fi;\
	done;\

-include Makefile_targets