Autor Beitrag
Tachoron
Hält's aus hier
Beiträge: 5



BeitragVerfasst: Do 05.02.09 18:08 
Hi ich hoffe das passt einigermaßen in das Forum hier.

Ich habe ein C-Projekt in Dev-C++ und will das Makefile dahingehend anpassen
das ich zusätzlich zur normalen Compiliervorgang noch ein Lint-NT MisraCheck durchgeführt wird.
Sprich eigentlich muss nur für jede C-Datei die kompiliert wird zusätzlich folgendes aufgerufen werden:

lint-nt lint_single_file.lnt c-datei.c
(lint-nt ist die *.exe, lint_single_file.lnt ist die immer gleich bleibende Regeldatei)

Meine (automatisch generierte) makedatei sieht dabei folgendermaßen aus:
ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
# Project: Datalogger_EmbeddedSoftware
# Makefile created by Dev-C++ 4.9.9.2

CPP  = g++.exe
CC   = gcc.exe
WINDRES = windres.exe
RES  = Datalogger_EmbeddedSoftware_private.res
OBJ  = main.o api_ram.o $(RES)
LINKOBJ  = main.o api_ram.o $(RES)
LIBS =  -L"C:/Programme/Dev-Cpp/lib"  
INCS =  -I"C:/Programme/Dev-Cpp/include" 
CXXINCS =  -I"C:/Programme/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"C:/Programme/Dev-Cpp/include/c++/3.4.2/backward"  -I"C:/Programme/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"C:/Programme/Dev-Cpp/include/c++/3.4.2"  -I"C:/Programme/Dev-Cpp/include" 
BIN  = Datalogger_EmbeddedSoftware.exe
CXXFLAGS = $(CXXINCS)  
CFLAGS = $(INCS)  
RM = rm -f

.PHONY: all all-before all-after clean clean-custom

all: all-before Datalogger_EmbeddedSoftware.exe all-after


clean: clean-custom
  ${RM} $(OBJ) $(BIN)

$(BIN): $(OBJ)
  $(CC) $(LINKOBJ) -o "Datalogger_EmbeddedSoftware.exe" $(LIBS)

main.o: main.c
  $(CC) -c main.c -o main.o $(CFLAGS)

api_ram.o: api_ram.c
  $(CC) -c api_ram.c -o api_ram.o $(CFLAGS)

Datalogger_EmbeddedSoftware_private.res: Datalogger_EmbeddedSoftware_private.rc 
  $(WINDRES) -i Datalogger_EmbeddedSoftware_private.rc --input-format=rc -o Datalogger_EmbeddedSoftware_private.res -O coff


Nun kann man bei DevC++ scheinbar zusätzlich Makefile Addons (*.mak) einfügen.
WIe kann ich eine solche Makefile-Datei einfügen, das alle C-Dateien geprüft werden und mir Fehler in DevC++ angezeigt werden?

MfG
Tachoron
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 05.02.09 18:19 
Du könntest das als zusätzliches Target einbauen:

ausblenden Quelltext
1:
2:
lint: *.c
  $LINT deine_datei.lnt $*


Wenn Lint auch mehrere Zeilen beherrscht.

Ansonsten ungefähr so:

ausblenden Quelltext
1:
2:
3:
4:
.PHONY lint: *.lnt

*.lnt: *.c
  $LINT deine_datei.lnt $CFile > $LNT-OutputFile


Wobei Du mal bei Make nachschauen solltest, wie das bei File-Extension-Regeln mit dem Zugriff auf den Dateinamen explizit funktioniert.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Tachoron Threadstarter
Hält's aus hier
Beiträge: 5



BeitragVerfasst: Fr 06.02.09 13:14 
Hi,

Danke erstmal für die ANtwort.

MUss ich das dann so in das Makefile-Addon schreiben?

ausblenden Quelltext
1:
2:
3:
4:
LINT = "C:\...\lint\LINT-NT"

lint: *.c
  $LINT lint_single_file.lnt $*


Und was ist das $* am ende?

Weil zumindest tut sich so nichts...kein Eintrag in der Dev-C++ Konsole.

Gruß
Tachoron
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Fr 06.02.09 13:34 
Du musst dein zusätzliches Target auch im all-before oder all-after Target anmelden, damit das mit erzeugt wird ...

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.