Skip to content

Commit

Permalink
Update formatting for Fortran Makefile.
Browse files Browse the repository at this point in the history
  • Loading branch information
MilanSkocic committed Nov 21, 2024
1 parent 2b255c1 commit d9db55f
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,22 @@ endif

SRC_FYPP=$(wildcard ./src/*.fypp)

.PHONY: build data stdlib fortran python cpython doc docs clean logo
.PHONY: build sources stdlib doc docs clean logo

all: $(LIBNAME)

$(LIBNAME): sources build copy_a shared

# ---------------------------------------------------------------------
# SOURCES
sources:
make -C src
make -C stdlib
# ---------------------------------------------------------------------


# ---------------------------------------------------------------------
# COMPILATION
build:
fpm build --profile=$(btype)

Expand All @@ -26,7 +36,11 @@ test: build

example: build
fpm run --profile=$(btype) --example example_in_f
# ---------------------------------------------------------------------


# ---------------------------------------------------------------------
# LINKING - STATIC and DYNAMIC LIBS
copy_a:
cp -f $(shell find ./build/gfortran* -type f -name $(LIBNAME).a) $(BUILD_DIR)

Expand All @@ -40,7 +54,11 @@ shared_darwin:

shared_windows:
$(FC) -shared $(FPM_LDFLAGS) -o $(BUILD_DIR)/$(LIBNAME).dll -Wl,--out-implib=$(BUILD_DIR)/$(LIBNAME).dll.a,--export-all-symbols,--enable-auto-import,--whole-archive $(BUILD_DIR)/$(LIBNAME).a -Wl,--no-whole-archive
# ---------------------------------------------------------------------


# ---------------------------------------------------------------------
# INSTALLATION
install: install_dirs install_$(PLATFORM)

install_dirs:
Expand Down Expand Up @@ -70,14 +88,11 @@ uninstall:
rm -f $(install_dir)/lib/$(LIBNAME).dll.a
rm -f $(install_dir)/lib/$(LIBNAME).dll
rm -f $(install_dir)/bin/$(LIBNAME).dll
# ---------------------------------------------------------------------

data:
make -C data

sources: data
make -C src
make -C stdlib

# ---------------------------------------------------------------------
# OTHERS
doc:
ford API-doc-FORD-file.md

Expand All @@ -89,11 +104,8 @@ logo:
make -C media

clean:
make -C data clean
make -C src clean
make -C include clean
make -C stdlib clean
make -C C clean
make -C py clean
fpm clean --all
rm -rf API-doc/*
# ---------------------------------------------------------------------

0 comments on commit d9db55f

Please sign in to comment.