From eac6bb8df6c080a8a4547b2f9ea052d924f3bfdd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 1 Jun 2012 00:50:39 -0400 Subject: [PATCH] makefile updates for serial cross compile --- src/MAKE/Makefile.mingw32-cross-serial | 15 ++++------ src/STUBS/Makefile.mingw32-cross | 40 ++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 9 deletions(-) create mode 100644 src/STUBS/Makefile.mingw32-cross diff --git a/src/MAKE/Makefile.mingw32-cross-serial b/src/MAKE/Makefile.mingw32-cross-serial index 5e6dc5e9da..37aa75d71a 100644 --- a/src/MAKE/Makefile.mingw32-cross-serial +++ b/src/MAKE/Makefile.mingw32-cross-serial @@ -13,7 +13,7 @@ DEPFLAGS = -M LINK = i686-pc-mingw32-g++ LINKFLAGS = -O LIB = -lwsock32 # -lwsock32 is needed for USER-IMD which uses tcp/ip sockets. -ARCHIVE = ar +ARCHIVE = i686-pc-mingw32-ar ARFLAGS = -rcsv SIZE = i686-pc-mingw32-size @@ -34,9 +34,9 @@ LMP_INC = -DLAMMPS_XDR # -DLAMMPS_GZIP -DMALLOC_MEMALIGN=64 # PATH = path for MPI library # LIB = name of MPI library -MPI_INC = -I../STUBS -MPI_PATH = -MPI_LIB = mpi.o +MPI_INC = -I../STUBS +MPI_PATH = +MPI_LIB = ../STUBS/libmpi.a # FFT library, OPTIONAL # see discussion in doc/Section_start.html#2_2 (step 6) @@ -45,7 +45,7 @@ MPI_LIB = mpi.o # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -DFFT_NONE #-DFFT_SINGLE +FFT_INC = -DFFT_NONE -DFFT_SINGLE FFT_PATH = FFT_LIB = #-lfftw @@ -78,7 +78,7 @@ $(EXE): $(EXE).exe ../MAKE/mingw_cross.nsis (cd ..; zip -0 lammps-icms-win.zip lammps-icms-win.exe) touch $(EXE) -$(EXE).exe: $(OBJ) mpi.o +$(EXE).exe: $(OBJ) ../STUBS/libmpi.a $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE).exe $(SIZE) $(EXE).exe @@ -97,8 +97,5 @@ lib: $(OBJ) # Individual dependencies -mpi.o: ../STUBS/mpi.c ../STUBS/mpi.h - $(CC) $(CCFLAGS) $(EXTRA_INC) -c $< - DEPENDS = $(OBJ:.o=.d) sinclude $(DEPENDS) diff --git a/src/STUBS/Makefile.mingw32-cross b/src/STUBS/Makefile.mingw32-cross new file mode 100644 index 0000000000..3b885e7925 --- /dev/null +++ b/src/STUBS/Makefile.mingw32-cross @@ -0,0 +1,40 @@ +# Makefile for MPI stubs - edit this for your platform + +SHELL = /bin/sh +.IGNORE: + +# Files + +SRC = mpi.c +INC = mpi.h + +# Definitions + +EXE = libmpi.a +OBJ = $(SRC:.c=.o) + +# System-specific settings + +CC = i686-pc-mingw32-gcc +CCFLAGS = -O2 -Wall -march=i686 -mtune=generic -mfpmath=387 -mpc64 # -fPIC +ARCHIVE = i686-pc-mingw32-ar +ARCHFLAG = rs + +# Target + +$(EXE): $(OBJ) + $(ARCHIVE) $(ARCHFLAG) $(EXE) $(OBJ) + +# Clean + +clean: + rm *.o libmpi.a + +# Compilation rules + +.c.o: + $(CC) $(CCFLAGS) -c $< + +# Individual dependencies + +$(OBJ): $(INC)