makefile

来自「linux下的一个分组遗传算法」· 代码 · 共 114 行

TXT
114
字号
## Makefile## A Makefile for projects that requires minimal adaptation.# Only the variables before the line of #'s should be changed.# Be sure to have all your source files in the same directory# as this Makefile, and no extra source files, as it will try# to compile all files with $(SUFFIX) as its suffix.## Author : J.I.v.Hemert# Version: 1.2#### Targets ###TITLE = src-projectBIN = ggaDISTNAME = projectTAGSFILE = tagsTARSUFFIX = .tar.gz### Directories ###BINDIR = ../binDEBUGDIR = ../debug### Misc ###SUFFIX = ccVPATH = .MACHINE = `uname`### Flags ####-ldmalloc LIBS = -lm #-lccmalloc -ldlLIBPATH = -L/home/jvhemert/lib/$(MACHINE)INCPATH = -I/home/jvhemert/includeLDFLAGS = -gCFLAGS = -Wall -O3CPPFLAGS = -Wall -O3TAGSFLAGS = -t -o $(TAGSFILE)DEFINES = -D$(MACHINE)TARFLAGS = cfzRMFLAGS = -f### Progs ###RM = rm $(RMFLAGS)CC = g++LINKER = $(CC)CTAGS = ctags $(TAGSFLAGS)TAR = tar $(TARFLAGS)SHELL = /bin/shMOVE = mv##############################################################               NO CHANGES FROM HERE ON                     ##############################################################OFILES = $(patsubst %.$(SUFFIX),%.o,$(wildcard *.$(SUFFIX)))HFILES = $(patsubst %.$(SUFFIX),%.h,$(wildcard *.$(SUFFIX)))CFILES = $(wildcard *.$(SUFFIX)).PHONY: clean proper all backup tags dist showdeps realclean install### Program ###$(BIN): $(OFILES)	$(LINKER) $(LDFLAGS) -o $@ $^ $(LIBPATH) $(LIBS)%.o: %.$(SUFFIX)	$(CC) $(CPPFLAGS) $(DEFINES) $(INCPATH) -c $^ -o $@tags:	-$(RM) $(TAGSFILE)	$(CTAGS) $(CFILES)showdeps:	$(CC) -MM $(CFILES)all install: $(BIN)	-strip $(BIN)	-$(MOVE) $(BIN) $(BINDIR)### Clean ###realclean proper: clean	-$(RM) $(BINDIR)/$(BIN) $(BIN)clean:	-$(RM) $(OFILES) $(DEBUGDIR)/* $(TAGSFILE)### Misc ###backup: proper	-$(RM) ../$(TITLE)-`date +'%d%m%y-%H%M'`$(TARSUFFIX)	$(TAR) ../$(TITLE)-`date +'%d%m%y-%H%M'`$(TARSUFFIX) *dist: proper	-$(RM) ../$(DISTNAME)$(TARSUFFIX)	$(TAR) ../$(DISTNAME)$(TARSUFFIX) *# eof() Makefile

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?