1# library build -*- makefile -*-
2SHELL = /bin/sh
3
4# ------ FILES ------
5SRC = $(wildcard *.cpp)
6INC = $(wildcard *.h)
7
8# ------ DEFINITIONS ------
9# which file will be copied to Makefile.lammps
10
11EXTRAMAKE = Makefile.lammps.linalg
12
13DIR = Obj_mingw64/
14LIB = $(DIR)libatc.a
15OBJ = $(SRC:%.cpp=$(DIR)%.o)
16
17# ------ SETTINGS ------
18
19# include any MPI settings needed for the ATC library to build with
20# the same MPI library that LAMMPS is built with
21
22CC =		  x86_64-w64-mingw32-g++
23CCFLAGS =	-I../../src -I../../src/STUBS -DMPICH_IGNORE_CXX_SEEK	\
24		-O3 -march=core2 -mtune=core2 -mpc64 -msse2    \
25                -ffast-math -funroll-loops -fstrict-aliasing		\
26		-DLAMMPS_SMALLBIG -Wno-uninitialized
27ARCHIVE =	x86_64-w64-mingw32-ar
28ARCHFLAG =	-rcs
29DEPFLAGS =      -M
30LINK =         	x86_64-w64-mingw32-g++
31LINKFLAGS =	-O
32USRLIB =
33SYSLIB =
34
35# ------ MAKE PROCEDURE ------
36
37default: $(DIR) $(LIB) Makefile.lammps
38
39$(DIR):
40	mkdir $(DIR)
41
42Makefile.lammps:
43	@cp $(EXTRAMAKE) Makefile.lammps
44
45$(LIB): 	$(OBJ)
46	$(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ)
47	@cp $(EXTRAMAKE) Makefile.lammps
48
49# ------ COMPILE RULES ------
50
51$(DIR)%.o:%.cpp
52	$(CC) $(CCFLAGS) -c $< -o $@
53$(DIR)%.d:%.cpp
54	$(CC) $(CCFLAGS) $(DEPFLAGS) $< > $@
55
56# ------ DEPENDENCIES ------
57
58DEPENDS = $(OBJ:.o=.d)
59
60# ------ CLEAN ------
61
62clean:
63	rm $(DIR)*.o $(DIR)*.d *~ $(LIB)
64
65$(DEPENDS) : $(DIR)
66sinclude $(DEPENDS)
67