8000 Make sure bin directory is created when building examples · arrayfire/arrayfire-fortran@90b8162 · GitHub
[go: up one dir, main page]

Skip to content

Commit 90b8162

Browse files
committed
Make sure bin directory is created when building examples
1 parent 793b650 commit 90b8162

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@ BIN:=$(patsubst $(AF_FORT_EXAMPLE_DIR)/%.f90, $(AF_FORT_BIN_DIR)/%, $(SRC))
1414

1515
all: $(BIN)
1616

17-
$(AF_FORT_BIN_DIR)/%: $(AF_FORT_EXAMPLE_DIR)/%.f90 $(AF_FORT_MOD)
17+
$(AF_FORT_BIN_DIR)/.flag:
18+
mkdir -p $(AF_FORT_BIN_DIR)
19+
touch $@
20+
21+
$(AF_FORT_BIN_DIR)/%: $(AF_FORT_EXAMPLE_DIR)/%.f90 $(AF_FORT_MOD) $(AF_FORT_BIN_DIR)/.flag
1822
@echo Building $(shell (basename $@))
1923
@gfortran -L$(AF_PATH)/$(LIB) $(CFLAGS) $(LDFLAGS) $(AF_FORT_MOD) -o $@ $<
2024

2125
clean:
2226
rm -f $(BIN)
27+
rm -f $(AF_FORT_BIN_DIR)/.flag
28+
rmdir $(AF_FORT_BIN_DIR)

0 commit comments

Comments
 (0)
0