1# library build -*- makefile -*- 2SHELL = /bin/sh 3 4# which file will be copied to Makefile.lammps 5EXTRAMAKE = Makefile.lammps.linalg 6 7# ------ FILES ------ 8 9SRC = $(wildcard *.cpp) 10INC = $(wildcard *.h) 11 12# ------ DEFINITIONS ------ 13 14LIB = libatc.a 15OBJ = $(SRC:.cpp=.o) 16 17default: lib 18 19# ------ SETTINGS ------ 20 21.PHONY: clean lib depend 22 23# include any MPI settings needed for the ATC library to build with 24# must be the same MPI library that LAMMPS is built with 25 26CC = g++ 27CCFLAGS = -O3 -g -fPIC 28CPPFLAGS = -I../../src -I../../src/STUBS 29ARCHIVE = ar 30ARCHFLAG = -rc 31# ------ MAKE PROCEDURE ------ 32 33lib: $(OBJ) 34 $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) 35 @cp $(EXTRAMAKE) Makefile.lammps 36 37# ------ COMPILE RULES ------ 38 39%.o:%.cpp 40 $(CC) $(CPPFLAGS) $(CCFLAGS) -c $< 41 42# ------ DEPENDENCIES ------ 43 44depend .depend : fastdep.exe $(SRC) 45 @./fastdep.exe $(INCFLAGS) -- $^ > .depend || exit 1 46 47fastdep.exe: ../../src/DEPEND/fastdep.c 48 @cc -O -o $@ $< 49 50# ------ CLEAN ------ 51 52clean: 53 -rm -f *.o *~ .depend $(LIB) fastdep.exe 54 55sinclude .depend 56