mirror of
https://gitlab.com/scemama/irpf90.git
synced 2024-12-22 20:33:39 +01:00
Replace AR by ARCHIVE
This commit is contained in:
parent
da3ee8864a
commit
2027274583
@ -36,9 +36,9 @@ FILENAME_GITIGNORE = ".gitignore"
|
|||||||
IRPF90_MAKE = "irpf90.make"
|
IRPF90_MAKE = "irpf90.make"
|
||||||
|
|
||||||
if sys.platform in ["linux", "linux2"]:
|
if sys.platform in ["linux", "linux2"]:
|
||||||
AR = "ar crs"
|
ARCHIVE = "ar crs"
|
||||||
elif sys.platform == "darwin":
|
elif sys.platform == "darwin":
|
||||||
AR = "libtool -static -o"
|
ARCHIVE = "libtool -static -o"
|
||||||
else:
|
else:
|
||||||
print("Unknown platform. Only Linux and Darwin are supported.")
|
print("Unknown platform. Only Linux and Darwin are supported.")
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
@ -58,7 +58,7 @@ def create():
|
|||||||
FC = gfortran
|
FC = gfortran
|
||||||
FCFLAGS= -O2 -ffree-line-length-none -I .
|
FCFLAGS= -O2 -ffree-line-length-none -I .
|
||||||
NINJA = ninja
|
NINJA = ninja
|
||||||
AR = %s
|
ARCHIVE= %s
|
||||||
RANLIB = ranlib
|
RANLIB = ranlib
|
||||||
|
|
||||||
SRC=
|
SRC=
|
||||||
@ -70,7 +70,7 @@ export
|
|||||||
|
|
||||||
%s: $(filter-out %s%%, $(wildcard */*.irp.f)) $(wildcard *.irp.f) $(wildcard *.inc.f) Makefile
|
%s: $(filter-out %s%%, $(wildcard */*.irp.f)) $(wildcard *.irp.f) $(wildcard *.inc.f) Makefile
|
||||||
\t$(IRPF90)
|
\t$(IRPF90)
|
||||||
"""%(AR,IRPF90_MAKE,IRPF90_MAKE,irpdir)
|
"""%(ARCHIVE,IRPF90_MAKE,IRPF90_MAKE,irpdir)
|
||||||
file.write(t)
|
file.write(t)
|
||||||
file.close()
|
file.close()
|
||||||
create_gitignore()
|
create_gitignore()
|
||||||
@ -197,7 +197,7 @@ def run_make():
|
|||||||
print(dir+"%.o: %.F\n\t$(FC) $(FCFLAGS) -c $*.F -o "+dir+"$*.o", file=file)
|
print(dir+"%.o: %.F\n\t$(FC) $(FCFLAGS) -c $*.F -o "+dir+"$*.o", file=file)
|
||||||
print(dir+"%.irp.F90: "+IRPF90_MAKE+"\n", file=file)
|
print(dir+"%.irp.F90: "+IRPF90_MAKE+"\n", file=file)
|
||||||
print("move:\n\t@mv -f *.mod IRPF90_temp/ 2> /dev/null | DO_NOTHING=\n", file=file)
|
print("move:\n\t@mv -f *.mod IRPF90_temp/ 2> /dev/null | DO_NOTHING=\n", file=file)
|
||||||
print("IRPF90_temp/irpf90.a: $(OBJ) $(OBJ1)\n\t$(AR) IRPF90_temp/irpf90.a $(OBJ1)\n", file=file)
|
print("IRPF90_temp/irpf90.a: $(OBJ) $(OBJ1)\n\t$(ARCHIVE) IRPF90_temp/irpf90.a $(OBJ1)\n", file=file)
|
||||||
print("clean:\n\trm -rf $(EXE) $(OBJ1) IRPF90_temp/irpf90.a $(ALL_OBJ1) $(ALL)\n", file=file)
|
print("clean:\n\trm -rf $(EXE) $(OBJ1) IRPF90_temp/irpf90.a $(ALL_OBJ1) $(ALL)\n", file=file)
|
||||||
print("veryclean:\n\t- $(MAKE) clean\n", file=file)
|
print("veryclean:\n\t- $(MAKE) clean\n", file=file)
|
||||||
print("\t- rm -rf "+irpdir+" "+mandir+" "+IRPF90_MAKE+" irpf90_entities dist tags\n", file=file)
|
print("\t- rm -rf "+irpdir+" "+mandir+" "+IRPF90_MAKE+" irpf90_entities dist tags\n", file=file)
|
||||||
|
16
src/ninja.py
16
src/ninja.py
@ -39,6 +39,14 @@ cwd = os.getcwd()
|
|||||||
|
|
||||||
PRINT_WIDTH=50
|
PRINT_WIDTH=50
|
||||||
|
|
||||||
|
if sys.platform in ["linux", "linux2"]:
|
||||||
|
AR = "ar crs"
|
||||||
|
elif sys.platform == "darwin":
|
||||||
|
AR = "libtool -static -o"
|
||||||
|
else:
|
||||||
|
print("Unknown platform. Only Linux and Darwin are supported.")
|
||||||
|
sys.exit(-1)
|
||||||
|
|
||||||
def dress(f,in_root=False):
|
def dress(f,in_root=False):
|
||||||
"""
|
"""
|
||||||
Transfoms the filename f into $PWD/IRPF90_temp/f
|
Transfoms the filename f into $PWD/IRPF90_temp/f
|
||||||
@ -271,8 +279,8 @@ def run():
|
|||||||
try: FC = os.environ["FC"]
|
try: FC = os.environ["FC"]
|
||||||
except KeyError: FC="gfortran -ffree-line-length-none"
|
except KeyError: FC="gfortran -ffree-line-length-none"
|
||||||
|
|
||||||
try: AR = os.environ["AR"]
|
try: ARCHIVE = os.environ["ARCHIVE"]
|
||||||
except KeyError: AR="ar crs"
|
except KeyError: ARCHIVE=AR
|
||||||
|
|
||||||
try: CC = os.environ["CC"]
|
try: CC = os.environ["CC"]
|
||||||
except KeyError: CC="gcc"
|
except KeyError: CC="gcc"
|
||||||
@ -329,14 +337,14 @@ def run():
|
|||||||
" description = C++ : $short_in -> $short_out",
|
" description = C++ : $short_in -> $short_out",
|
||||||
"",
|
"",
|
||||||
"rule link_lib_{id}",
|
"rule link_lib_{id}",
|
||||||
" command = {AR} $out $in" ,
|
" command = {ARCHIVE} $out $in" ,
|
||||||
" description = Link: $short_out",
|
" description = Link: $short_out",
|
||||||
"",
|
"",
|
||||||
"rule link_{id}",
|
"rule link_{id}",
|
||||||
" command = {FC} $in {LIB} -o $out" ,
|
" command = {FC} $in {LIB} -o $out" ,
|
||||||
" description = Link: $short_out"]
|
" description = Link: $short_out"]
|
||||||
|
|
||||||
output += [ '\n'.join(t).format(id=irp_id, FC=FC, FCFLAGS=FCFLAGS, LIB=LIB, CXX=CXX, CXXFLAGS=CXXFLAGS, CC=CC, CFLAGS=CFLAGS, AR=AR) ]
|
output += [ '\n'.join(t).format(id=irp_id, FC=FC, FCFLAGS=FCFLAGS, LIB=LIB, CXX=CXX, CXXFLAGS=CXXFLAGS, CC=CC, CFLAGS=CFLAGS, ARCHIVE=ARCHIVE) ]
|
||||||
|
|
||||||
|
|
||||||
# All modules : list of Fmodule objects
|
# All modules : list of Fmodule objects
|
||||||
|
Loading…
Reference in New Issue
Block a user