Skip to content

Commit

Permalink
Only for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
minhqdao committed Mar 4, 2024
1 parent ea17755 commit 1fa8d27
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ STATIC := lib$(NAME).a

ifeq ($(shell uname), Linux)
SHARED := lib$(NAME).so
LDFLAGS := -rpath=.
else ifeq ($(shell uname), Darwin)
SHARED := lib$(NAME).dylib
endif
Expand Down Expand Up @@ -71,11 +72,11 @@ $(EXEDIRSTATIC)/%.out: $(EXMPLDIR)/%.f90 $(STATIC)

$(EXEDIRSHARED)/%.out: $(TESTDIR)/%.f90 $(SHARED)
mkdir -p $(EXEDIRSHARED)
$(FC) $(FFLAGS) $(MODIN) -o $@ $< $(SHARED) -Wl,-rpath=.
$(FC) $(FFLAGS) $(MODIN) -o $@ $< $(SHARED) $(LDFLAGS)

$(EXEDIRSHARED)/%.out: $(EXMPLDIR)/%.f90 $(SHARED)
mkdir -p $(EXEDIRSHARED)
$(FC) $(FFLAGS) $(MODIN) -o $@ $< $(SHARED) -Wl,-rpath=.
$(FC) $(FFLAGS) $(MODIN) -o $@ $< $(SHARED) $(LDFLAGS)

test: $(TESTEXESSTATIC) $(TESTEXESSHARED) $(EXMPLEXESSTATIC) $(EXMPLEXESSHARED)
@for f in $^; do $$f; done
Expand Down

0 comments on commit 1fa8d27

Please sign in to comment.