[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multiple Compiler Options
From: |
Emanuel Berg |
Subject: |
Re: Multiple Compiler Options |
Date: |
Mon, 09 Aug 2021 22:54:52 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> here it is better to have a Makefile and then just have
> compile-command' "make -k " or something.
Here is a Makefile for a Hello World example with gfortran and
Fortran 90.
Now compile from Emacs (from the hello.f90 buffer) with
M-x compile RET (I have that C-c C-c).
You can also compile from the shell with 'make', run it with
'make run', and remove the executable (not the source) with
'make clean'.
OK, the files, in hello.f90:
program hello
print *, 'Hello, Erin!'
end program hello
And in Makefile:
name=hello
src=${name}.f90
exe=${name}
all: ${src}
gfortran $< -o ${exe}
run: ${exe}
$<
clean:
rm ${exe}
--
underground experts united
https://dataswamp.org/~incal