Skip to content

Commit

Permalink
Better rules for makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-ricardo committed Apr 9, 2019
1 parent 9a0378b commit 87649fc
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions bin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,24 @@ Fort_Lin = $(Fort) -g $(Opt_flags)
#List of objects to compile
File_list = test_link.o linked_list.o

# Rules for make
#------------------------
# Build
all: $(File_list)
$(Fort_Lin) *.o -o $(exe)
#------------------------

# Generic rules
%.mod: %.o
@true

%.o: $(src)/%.f08
$(Fort_Mod) $<

# Objects list and dependencies
linked_list.o: $(src)/linked_list.f08
test_link.o: $(src)/test_link.f08 linked_list.mod


# Objects rules
linked_list.o:
$(Fort_Mod) $(src)/linked_list.f08
test_link.o: linked_list.o
$(Fort_Mod) $(src)/test_link.f08 -o test_link.o

#------------------------
# Clean make dir
Expand Down

0 comments on commit 87649fc

Please sign in to comment.