1# *
2# *_________________________________________________________________________*
3# *      POEMS: PARALLELIZABLE OPEN SOURCE EFFICIENT MULTIBODY SOFTWARE     *
4# *      DESCRIPTION: SEE READ-ME                                           *
5# *      FILE NAME: Makefile                                                *
6# *      AUTHORS: See Author List                                           *
7# *      GRANTS: See Grants List                                            *
8# *      COPYRIGHT: (C) 2005 by Authors as listed in Author's List          *
9# *      LICENSE: Please see License Agreement                              *
10# *      DOWNLOAD: Free at www.rpi.edu/~anderk5                             *
11# *      ADMINISTRATOR: Prof. Kurt Anderson                                 *
12# *                     Computational Dynamics Lab                          *
13# *                     Rensselaer Polytechnic Institute                    *
14# *                     110 8th St. Troy NY 12180                           *
15# *      CONTACT:        anderk5@rpi.edu                                    *
16# *_________________________________________________________________________*/
17
18SHELL = /bin/sh
19
20# which file will be copied to Makefile.lammps
21
22EXTRAMAKE = Makefile.lammps.empty
23
24# ------ FILES ------
25
26SRC_MAIN = workspace.cpp system.cpp poemsobject.cpp
27INC_MAIN = workspace.h system.h poemsobject.h
28
29SRC_BODY =      body.cpp rigidbody.cpp particle.cpp inertialframe.cpp
30INC_BODY =      bodies.h body.h rigidbody.h particle.h inertialframe.h
31
32
33SRC_JOINT =     joint.cpp revolutejoint.cpp prismaticjoint.cpp sphericaljoint.cpp \
34    freebodyjoint.cpp body23joint.cpp mixedjoint.cpp
35INC_JOINT =     joints.h joint.h revolutejoint.h prismaticjoint.h sphericaljoint.h \
36    freebodyjoint.h body23joint.h mixedjoint.h
37
38SRC_POINT =     point.cpp fixedpoint.cpp
39INC_POINT =     points.h point.h fixedpoint.h
40
41SRC_SOLVE = solver.cpp
42INC_SOLVE = solver.h
43
44SRC_ORDERN = onsolver.cpp onfunctions.cpp onbody.cpp
45INC_ORDERN = onsolver.h onfunctions.h onbody.h
46
47SRC_MAT =       virtualmatrix.cpp matrix.cpp matrixfun.cpp mat3x3.cpp virtualcolmatrix.cpp \
48    colmatrix.cpp vect3.cpp virtualrowmatrix.cpp rowmatrix.cpp mat6x6.cpp vect6.cpp \
49    fastmatrixops.cpp colmatmap.cpp eulerparameters.cpp vect4.cpp norm.cpp mat4x4.cpp \
50
51INC_MAT =       matrices.h virtualmatrix.h matrix.h matrixfun.h mat3x3.h virtualcolmatrix.h \
52    colmatrix.h vect3.h virtualrowmatrix.h rowmatrix.h mat6x6.h vect6.h \
53    fastmatrixops.h colmatmap.h eulerparameters.h vect4.h norm.h mat4x4.h
54
55SRC_MISC = poemstreenode.cpp
56INC_MISC = poemslist.h poemstreenode.h poemstree.h poemsnodelib.h SystemProcessor.h defines.h POEMSChain.h
57
58SRC = $(SRC_MAIN) $(SRC_BODY) $(SRC_JOINT) $(SRC_POINT) $(SRC_SOLVE) $(SRC_ORDERN) $(SRC_MAT) $(SRC_MISC)
59INC = $(INC_MAIN) $(INC_BODY) $(INC_JOINT) $(INC_POINT) $(INC_SOLVE) $(INC_ORDERN) $(INC_MAT) $(INC_MISC)
60
61FILES = $(SRC) $(INC) Makefile Authors_List.txt Grants_List.txt POEMS_License.txt README Copyright_Notice
62
63# ------ DEFINITIONS ------
64
65DIR = Obj_mingw32/
66LIB = $(DIR)libpoems.a
67OBJ = $(SRC:%.cpp=$(DIR)%.o)
68
69# ------ SETTINGS ------
70
71CC =	        i686-w64-mingw32-g++
72CCFLAGS =	-O2 -march=i686 -mtune=generic -mfpmath=387 -mpc64	\
73		-ffast-math -funroll-loops -finline-functions -fno-rtti	\
74		-fno-exceptions -fstrict-aliasing \
75		-Wall -W -Wno-uninitialized
76ARCHIVE =	i686-w64-mingw32-ar
77ARCHFLAG =	-rcs
78DEPFLAGS =      -M
79LINK =         	i686-w64-mingw32-g++
80LINKFLAGS =	-O
81USRLIB =
82SYSLIB =
83
84# ------ MAKE PROCEDURE ------
85
86default: $(DIR) $(LIB)
87
88$(DIR):
89	-mkdir $(DIR)
90
91$(LIB): $(OBJ)
92	$(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ)
93	@cp $(EXTRAMAKE) Makefile.lammps
94
95# ------ COMPILE RULES ------
96
97$(DIR)%.o:%.cpp
98	$(CC) $(CCFLAGS) -c $< -o $@
99
100$(DIR)%.d:%.cpp
101	$(CC) $(CCFLAGS) $(DEPFLAGS) $< > $@
102
103# ------ DEPENDENCIES ------
104
105DEPENDS = $(OBJ:.o=.d)
106
107# ------ CLEAN ------
108
109clean:
110	-rm $(DIR)*.o $(DIR)*.d *~ $(LIB)
111
112tar:
113	-tar -cvf ../POEMS.tar $(FILES)
114