Last active
August 29, 2015 14:16
-
-
Save chirimenmonster/f72a7411cded889b3771 to your computer and use it in GitHub Desktop.
Fortran で使う Makefile の書き方 (for GNU Make)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program main | |
use sub | |
call helloworld | |
end program main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FC = gfortran | |
TARGET = sample | |
OBJS = main.o sub.o | |
.SUFFIXES: .f90 | |
%.o: %.f90 | |
$(COMPILE.f) $(OUTPUT_OPTION) $< | |
%.mod: %.f90 %.o | |
@: | |
$(TARGET): $(OBJS) | |
$(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@ | |
main.o: sub.mod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module sub | |
use, intrinsic :: iso_fortran_env | |
contains | |
subroutine helloworld | |
write(output_unit, '(*(g0))') 'Hello World!' | |
end subroutine helloworld | |
end module sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment