2014-12-02 10:12:19 +08:00
|
|
|
# library build -*- makefile -*-
|
2009-09-25 00:33:23 +08:00
|
|
|
SHELL = /bin/sh
|
|
|
|
|
2013-05-31 01:30:35 +08:00
|
|
|
# which file will be copied to Makefile.lammps
|
2014-12-02 10:12:19 +08:00
|
|
|
EXTRAMAKE = Makefile.lammps.linalg
|
2013-05-31 01:30:35 +08:00
|
|
|
|
2009-09-25 00:33:23 +08:00
|
|
|
# ------ FILES ------
|
2014-12-02 10:12:19 +08:00
|
|
|
|
2013-08-08 23:34:04 +08:00
|
|
|
SRC = $(wildcard *.cpp)
|
|
|
|
INC = $(wildcard *.h)
|
2009-09-25 00:33:23 +08:00
|
|
|
|
|
|
|
# ------ DEFINITIONS ------
|
|
|
|
|
|
|
|
LIB = libatc.a
|
|
|
|
OBJ = $(SRC:.cpp=.o)
|
|
|
|
|
2017-07-29 01:36:06 +08:00
|
|
|
default: lib
|
|
|
|
|
2009-09-25 00:33:23 +08:00
|
|
|
# ------ SETTINGS ------
|
|
|
|
|
2017-07-29 01:36:06 +08:00
|
|
|
.PHONY: clean lib depend
|
|
|
|
|
2009-09-25 00:33:23 +08:00
|
|
|
# include any MPI settings needed for the ATC library to build with
|
2013-05-31 03:19:20 +08:00
|
|
|
# must be the same MPI library that LAMMPS is built with
|
2009-09-25 00:33:23 +08:00
|
|
|
|
|
|
|
CC = g++
|
2017-07-29 01:36:06 +08:00
|
|
|
CCFLAGS = -O3 -g -fPIC
|
|
|
|
CPPFLAGS = -I../../src -I../../src/STUBS
|
2009-09-25 00:33:23 +08:00
|
|
|
ARCHIVE = ar
|
|
|
|
ARCHFLAG = -rc
|
|
|
|
# ------ MAKE PROCEDURE ------
|
|
|
|
|
|
|
|
lib: $(OBJ)
|
|
|
|
$(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ)
|
2013-05-31 03:19:50 +08:00
|
|
|
@cp $(EXTRAMAKE) Makefile.lammps
|
2009-09-25 00:33:23 +08:00
|
|
|
|
|
|
|
# ------ COMPILE RULES ------
|
|
|
|
|
|
|
|
%.o:%.cpp
|
2017-07-29 01:36:06 +08:00
|
|
|
$(CC) $(CPPFLAGS) $(CCFLAGS) -c $<
|
2009-09-25 00:33:23 +08:00
|
|
|
|
|
|
|
# ------ DEPENDENCIES ------
|
|
|
|
|
2017-07-29 01:36:06 +08:00
|
|
|
depend .depend : fastdep.exe $(SRC)
|
|
|
|
@./fastdep.exe $(INCFLAGS) -- $^ > .depend || exit 1
|
|
|
|
|
|
|
|
fastdep.exe: ../../src/DEPEND/fastdep.c
|
|
|
|
@cc -O -o $@ $<
|
2009-09-25 00:33:23 +08:00
|
|
|
|
|
|
|
# ------ CLEAN ------
|
|
|
|
|
|
|
|
clean:
|
2017-07-29 01:36:06 +08:00
|
|
|
-rm -f *.o *~ .depend $(LIB) fastdep.exe
|
2014-12-02 10:12:19 +08:00
|
|
|
|
2017-07-29 01:36:06 +08:00
|
|
|
sinclude .depend
|