Browse Source

Improve Makefile (no unneeded recompilation of executables)

master
J.-S. Caux 2 years ago
parent
commit
4af687fb03
1 changed files with 6 additions and 5 deletions
  1. 6
    5
      Makefile

+ 6
- 5
Makefile View File

62
 # Executables
62
 # Executables
63
 EXECUTABLES = $(patsubst %.$(SRC_EXT), $(BIN_DIR)/%, $(notdir $(SOURCES_EXECS)))
63
 EXECUTABLES = $(patsubst %.$(SRC_EXT), $(BIN_DIR)/%, $(notdir $(SOURCES_EXECS)))
64
 
64
 
65
+# Executables (parallel)
66
+EXECUTABLES_PAR = $(patsubst %.$(SRC_EXT), $(BIN_DIR)/%, $(notdir $(SOURCES_EXECS_PAR)))
67
+
65
 
68
 
66
 # Main target: all executables (and thus the library, and thus all objects)
69
 # Main target: all executables (and thus the library, and thus all objects)
67
 all: $(EXECUTABLES)
70
 all: $(EXECUTABLES)
68
 
71
 
69
 # Build executables
72
 # Build executables
70
-$(EXECUTABLES): $(BIN_DIR)/%: $(SRC_DIR)/EXECS/%.$(SRC_EXT) lib$(VERSION).a
73
+$(EXECUTABLES): $(BIN_DIR)/%: $(SRC_DIR)/EXECS/%.$(SRC_EXT) $(LIB_DIR)/lib$(VERSION).a
71
 	$(COMPILE) $< -o $@ -l$(VERSION)
74
 	$(COMPILE) $< -o $@ -l$(VERSION)
72
 
75
 
73
 # Compile all object files
76
 # Compile all object files
75
 	$(COMPILE) -c $< -o $@
78
 	$(COMPILE) -c $< -o $@
76
 
79
 
77
 # Create the ABACUS library
80
 # Create the ABACUS library
78
-lib$(VERSION).a : $(OBJECTS)
79
-	ar -cr lib$(VERSION).a $(OBJECTS)
80
-	mv lib$(VERSION).a $(LIB_DIR)/
81
-
81
+$(LIB_DIR)/lib$(VERSION).a : $(OBJECTS)
82
+	ar -cr $(LIB_DIR)/lib$(VERSION).a $(OBJECTS)
82
 
83
 
83
 ###########################################
84
 ###########################################
84
 # Cleanup
85
 # Cleanup

Loading…
Cancel
Save