Completed Makefile explanation doc for default target

This commit is contained in:
Jonathan Moallem 2021-02-19 18:40:18 +11:00
parent f639318260
commit bb57fdd905

View File

@ -177,15 +177,13 @@ $(target): $(objects)
$(CXX) $(objects) -o $(target) $(linkFlags) $(CXX) $(objects) -o $(target) $(linkFlags)
``` ```
```Makefile After this, the execute target will simply attempt to run the program from the command line with any supplied arguments.
all: $(target) execute clean
```
```Makefile ```Makefile
execute: execute:
$(target) $(ARGS) $(target) $(ARGS)
``` ```
Once the application is closed, crashed, or otherwise ended, the clean command will then be run (for the appropriate platform path and command), by deleting the `/bin/` directory, including object files, dependency files and the application itself. This prepares the build system for a fresh compilation.
```Makefile ```Makefile
clean: clean:
$(RM) $(call platformpth, $(buildDir)/*) $(RM) $(call platformpth, $(buildDir)/*)