Makefile Support in Visual Studio Code - Makefile VSCode Tutorial

preview_player
Показать описание

Unlock the power of makefiles within Visual Studio Code (VS Code) with our latest tutorial video. Dive into the seamless integration of makefiles with VS Code, your one-stop solution for a streamlined coding experience. We’ll guide you through the essentials—compiling your code, executing your programs, performing rigorous tests, and maintaining a clean workspace—all within the VS Code environment.

Stay tuned until the end as we unravel the enduring utility of makefiles. Despite the advent of newer tools, makefiles remain a stalwart ally, offering unmatched simplicity and control in build automation. Discover how makefiles bring their classic efficiency to the modern interface of VS Code, enhancing your development workflow with their robust functionality. Whether you’re a seasoned developer or just starting out, mastering makefiles in VS Code is a skill that will pay dividends in your programming endeavors.
Рекомендации по теме
Комментарии
Автор

Dang I was looking for a way to configure makefile as my build system in visual studio, I really wish that the folks at MS had given these two very different IDE's suitable different names, I'm sure this vid is great though, if you are using visual studio code, just felt the need to express my chagrin.

wily_rites
Автор

errors reported in the terminal window from compilation using makefile have no relation to problems reported by vscode. E.g. if have '-I.' option and it is handled correctly by compiler at the same time the vscode is unhappy because it could not find .h file with angle brackets.

qqiz
Автор

does vscode c/cpp use Makefile to generate intellisense/syntax highlight?

meinlet
Автор

For me almost nothing goes as you show. Possibly because I started my C project in Xcode but then went on to mostly use it in VScode but the Xcode project having an extra level seems to make everything unintuitive and frustrating and I just had to give up. For instance I had no pencil icon next to Configuration, Build target, and launch target. I finally figured out it was because my makefile isn't in <project>/makefile but in <project>/<project>/makefile because that's how Xcode sets up a project and that's where my main.c was. But even then I can't set Configuration. I click on the pencil and choose Default but configuration still says [Unset].

andrewdunbar
Автор

You setup your makefile incorrectly. Within gnumake the target specifies what you want to create before the semicolon and after it what it depends on. So:

DEFAULT_GOAL := ./target/CoinFlipper.out

./target/CoinFlipper.out: ./sourc/main/CointFlipper.cpp
gcc -o ./target/CoinFlipper.out ./sourc/main/CointFlipper.cpp

run: ./target/CoinFlipper.out
./target/CoinFlipper.out 10

test: ./target/CoinFlipper.out
./target/CoinFlipper.out 10000

cedricschmeits