diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2022-09-13 20:52:13 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2022-09-14 00:45:42 +0100 |
commit | b2898fb7d67369f7b6809563bae41c60ffb46a10 (patch) | |
tree | 3b6162b4c610a37614dab638ca5ef4ea0019f42c /Emacs/.config/emacs/config.org | |
parent | 0217fee4673b968a0d40b90e39710382602605b6 (diff) | |
download | dotfiles-b2898fb7d67369f7b6809563bae41c60ffb46a10.tar.gz dotfiles-b2898fb7d67369f7b6809563bae41c60ffb46a10.tar.bz2 dotfiles-b2898fb7d67369f7b6809563bae41c60ffb46a10.zip |
(Emacs)+object based compilation for Makefile auto insert
Faster overall, incremental compilation.
Diffstat (limited to 'Emacs/.config/emacs/config.org')
-rw-r--r-- | Emacs/.config/emacs/config.org | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index 1bb518d..018d7b9 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -922,23 +922,27 @@ as well. "" "CC=g++ CFLAGS=-Wall -ggdb -FILES=main.cpp +OBJECTS=main.o OUT=main +ARGS= -$(OUT): $(FILES) - $(CC) $(CFLAGS) $^ -o $@ +%.o: %.cpp + $(CC) $(CFLAGS) -c $^ -o $@ + +$(OUT): $(OBJECTS) + $(CC) $(CFLAGS) $^ -o $@ .PHONY: clean: - rm -rfv $(OUT) + rm -rfv $(OUT) $(OBJECTS) .PHONY: run run: $(OUT) - ./$^ + ./$^ $(ARGS) .PHONY: memcheck memcheck: $(OUT) - valgrind --tool=memcheck ./$^" + sh /etc/profile.d/debuginfod.sh && valgrind --leak-check=full -s --tool=memcheck ./$^ $(ARGS)" _))) #+end_src *** Yasnippet default |