avr-gcc / Atmel Studio -> make mit VSCode ausführen?

Gast #6274231
Lesenswert?

avr-gcc unter Windows enthält kein make.
Atmel Studio enthält ein älteres make: "C:\Program Files 
(x86)\Atmel\Studio\7.0\shellUtils\make.exe"

Damit klappt es sogar mit dem Bauen - offenbar sind im Makefile alle 
Pfade enthalten:
1
\Release>"C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe"
2
Building file: .././main.c
3
Invoking: AVR/GNU C Compiler : 5.4.0
4
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DNDEBUG  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATtiny_DFP\1.3.229\include"  -O3 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -mmcu=attiny85 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATtiny_DFP\1.3.229\gcc\dev\attiny85" -c -std=gnu99 -MD -MP -MF "main.d" -MT"main.d" -MT"main.o"   -o "main.o" ".././main.c"
5
.././main.c:357:6: warning: return type of 'main' is not 'int' [-Wmain]
6
 void main(void) {
7
      ^
8
Finished building: .././main.c

Wie kann ich das nun mit VSCode per Hotkey ausführen?
Und avrdude - kommt das besser als weiteres "target" ins Makefile oder 
separat als Hotkey in VSCode?
Gast #6274624
Lesenswert?

Nach dem ersten Absatz folgt leider ein spezifisches Beispiel für 
TypeScript, mit irgendwelchen Automatiken - besser dann hierhin:
https://code.visualstudio.com/docs/editor/tasks#_custom-tasks

Dann wird's fummelig; relative Pfadangaben funktionieren nicht so 
richtig.
Und ${cwd} ist nicht gleich "cwd".

.vscode/tasks.json
1
{
2
    "version": "2.0.0",
3
    "tasks": [
4
        {
5
            "type": "shell",
6
            "label": "build",
7
            "command": "C:\\Program Files (x86)\\Atmel\\Studio\\7.0\\shellUtils\\make.exe",
8
            "args": [
9
                "all",
10
            ],
11
            "options": {
12
                "cwd": ".\\Release"
13
            },
14
            "problemMatcher": [
15
                "$gcc"
16
            ],
17
            "group": {
18
                "kind": "build",
19
                "isDefault": true
20
            }
21
        },
22
        {
23
            "type": "shell",
24
            "label": "flash",
25
            "windows": {
26
                "command": "${cwd}\\Release\\avrdude.exe",
27
                "args": ["-pt85", "-cusbasp", "-B10", "-Uflash:w:GccApplication1.elf"                ],
28
                "options": {"cwd": "Release"},
29
            },
30
            "problemMatcher": [
31
            ],
32
            "group": "none",
33
            "presentation": {
34
                "reveal": "always"
35
                //, "panel": "new"
36
            }
37
        }
38
    ]
39
}

build: STRG SHIFT B
flash: STRG ALT T

Geht aber bestimmt noch schicker.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren