Простой make-файл. Почему .exe создается, а затем удаляется командой make?

Еще один вопрос от меня, где netbeans не создает .exe, но нет сообщений об ошибках от netbeans. Это все еще не решено. Так как меня попросили скомпилировать этот проект без IDE, но только с помощью команды «make», и я никогда не делал этого раньше, я создал эту простую программу, чтобы узнать о make-файлах.

//main.cpp
int main() {
int i = 1;
return 0;
}

Мой make-файл выглядит так:

project000: main.o
g++ -Wall main.o -o project000

main.o: main.cpp
g++ -Wall -c main.cpp

clean:
rm *.o project000

Когда я захожу в каталог проекта и выполняю команду make, создается файл .o, и я вижу, как создается файл project000.exe, а затем удаляется! Поэтому я проверил, выполняется ли «чистая» часть make-файла каждый раз, сокращая make-файл до

project000: main.o
g++ -Wall main.o -o project000

main.o: main.cpp
g++ -Wall -c main.cpp

но происходит то же самое. .Exe создается, а затем удаляется.

Кто-нибудь ?

Вывод ‘make -d’ (может не включать начало, так как в моем приглашении было слишком мало строк, когда я его запускал)

 Trying implicit prerequisite `Makefile.l'.
Looking for a rule with intermediate file `Make
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile.l'.
Trying implicit prerequisite `Makefile.l,v'.
Trying pattern rule with stem `Makefile.l'.
Trying implicit prerequisite `RCS/Makefile.l,v
Trying pattern rule with stem `Makefile.l'.
Trying implicit prerequisite `RCS/Makefile.l'.
Trying pattern rule with stem `Makefile.l'.
Trying implicit prerequisite `s.Makefile.l'.
Trying pattern rule with stem `Makefile.l'.
Trying implicit prerequisite `SCCS/s.Makefile.
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.w'.
Looking for a rule with intermediate file `Make
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile.w'.
Trying implicit prerequisite `Makefile.w,v'.
Trying pattern rule with stem `Makefile.w'.
Trying implicit prerequisite `RCS/Makefile.w,v
Trying pattern rule with stem `Makefile.w'.
Trying implicit prerequisite `RCS/Makefile.w'.
Trying pattern rule with stem `Makefile.w'.
Trying implicit prerequisite `s.Makefile.w'.
Trying pattern rule with stem `Makefile.w'.
Trying implicit prerequisite `SCCS/s.Makefile.
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Mak
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.cc'.
Looking for a rule with intermediate file `Makef
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile.cc'.
Trying implicit prerequisite `Makefile.cc,v'.
Trying pattern rule with stem `Makefile.cc'.
Trying implicit prerequisite `RCS/Makefile.cc,v
Trying pattern rule with stem `Makefile.cc'.
Trying implicit prerequisite `RCS/Makefile.cc'.
Trying pattern rule with stem `Makefile.cc'.
Trying implicit prerequisite `s.Makefile.cc'.
Trying pattern rule with stem `Makefile.cc'.
Trying implicit prerequisite `SCCS/s.Makefile.c
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.C'.
Looking for a rule with intermediate file `Makef
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile.C'.
Trying implicit prerequisite `Makefile.C,v'.
Trying pattern rule with stem `Makefile.C'.
Trying implicit prerequisite `RCS/Makefile.C,v'
Trying pattern rule with stem `Makefile.C'.
Trying implicit prerequisite `RCS/Makefile.C'.
Trying pattern rule with stem `Makefile.C'.
Trying implicit prerequisite `s.Makefile.C'.
Trying pattern rule with stem `Makefile.C'.
Trying implicit prerequisite `SCCS/s.Makefile.C
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.cpp'.
Looking for a rule with intermediate file `Makef
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile.cpp'.
Trying implicit prerequisite `Makefile.cpp,v'.
Trying pattern rule with stem `Makefile.cpp'.
Trying implicit prerequisite `RCS/Makefile.cpp,
Trying pattern rule with stem `Makefile.cpp'.
Trying implicit prerequisite `RCS/Makefile.cpp'
Trying pattern rule with stem `Makefile.cpp'.
Trying implicit prerequisite `s.Makefile.cpp'.
Trying pattern rule with stem `Makefile.cpp'.
Trying implicit prerequisite `SCCS/s.Makefile.c
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.p'.
Looking for a rule with intermediate file `Makef
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.web'.
Trying pattern rule with stem `Makefile.p'.
Trying implicit prerequisite `Makefile.p,v'.
Trying pattern rule with stem `Makefile.p'.
Trying implicit prerequisite `RCS/Makefile.p,v'
Trying pattern rule with stem `Makefile.p'.
Trying implicit prerequisite `RCS/Makefile.p'.
Trying pattern rule with stem `Makefile.p'.
Trying implicit prerequisite `s.Makefile.p'.
Trying pattern rule with stem `Makefile.p'.
Trying implicit prerequisite `SCCS/s.Makefile.p
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.web'.
Looking for a rule with intermediate file `Make
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile.web'.
Trying implicit prerequisite `Makefile.web,v'.
Trying pattern rule with stem `Makefile.web'.
Trying implicit prerequisite `RCS/Makefile.web
Trying pattern rule with stem `Makefile.web'.
Trying implicit prerequisite `RCS/Makefile.web
Trying pattern rule with stem `Makefile.web'.
Trying implicit prerequisite `s.Makefile.web'.
Trying pattern rule with stem `Makefile.web'.
Trying implicit prerequisite `SCCS/s.Makefile.
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.f'.
Looking for a rule with intermediate file `Makef
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.F'.
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.r'.
Trying pattern rule with stem `Makefile.f'.
Trying implicit prerequisite `Makefile.f,v'.
Trying pattern rule with stem `Makefile.f'.
Trying implicit prerequisite `RCS/Makefile.f,v'
Trying pattern rule with stem `Makefile.f'.
Trying implicit prerequisite `RCS/Makefile.f'.
Trying pattern rule with stem `Makefile.f'.
Trying implicit prerequisite `s.Makefile.f'.
Trying pattern rule with stem `Makefile.f'.
Trying implicit prerequisite `SCCS/s.Makefile.f
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.F'.
Looking for a rule with intermediate file `Make
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile.F'.
Trying implicit prerequisite `Makefile.F,v'.
Trying pattern rule with stem `Makefile.F'.
Trying implicit prerequisite `RCS/Makefile.F,v
Trying pattern rule with stem `Makefile.F'.
Trying implicit prerequisite `RCS/Makefile.F'.
Trying pattern rule with stem `Makefile.F'.
Trying implicit prerequisite `s.Makefile.F'.
Trying pattern rule with stem `Makefile.F'.
Trying implicit prerequisite `SCCS/s.Makefile.
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.r'.
Looking for a rule with intermediate file `Make
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Ma
Trying pattern rule with stem `Makefile.r'.
Trying implicit prerequisite `Makefile.r,v'.
Trying pattern rule with stem `Makefile.r'.
Trying implicit prerequisite `RCS/Makefile.r,v
Trying pattern rule with stem `Makefile.r'.
Trying implicit prerequisite `RCS/Makefile.r'.
Trying pattern rule with stem `Makefile.r'.
Trying implicit prerequisite `s.Makefile.r'.
Trying pattern rule with stem `Makefile.r'.
Trying implicit prerequisite `SCCS/s.Makefile.
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Make
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Make
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.s'.
Looking for a rule with intermediate file `Makef
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.S'.
Trying pattern rule with stem `Makefile.s'.
Trying implicit prerequisite `Makefile.s,v'.
Trying pattern rule with stem `Makefile.s'.
Trying implicit prerequisite `RCS/Makefile.s,v'
Trying pattern rule with stem `Makefile.s'.
Trying implicit prerequisite `RCS/Makefile.s'.
Trying pattern rule with stem `Makefile.s'.
Trying implicit prerequisite `s.Makefile.s'.
Trying pattern rule with stem `Makefile.s'.
Trying implicit prerequisite `SCCS/s.Makefile.s
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.S'.
Looking for a rule with intermediate file `Make
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile.S'.
Trying implicit prerequisite `Makefile.S,v'.
Trying pattern rule with stem `Makefile.S'.
Trying implicit prerequisite `RCS/Makefile.S,v
Trying pattern rule with stem `Makefile.S'.
Trying implicit prerequisite `RCS/Makefile.S'.
Trying pattern rule with stem `Makefile.S'.
Trying implicit prerequisite `s.Makefile.S'.
Trying pattern rule with stem `Makefile.S'.
Trying implicit prerequisite `SCCS/s.Makefile.
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Make
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.mod'.
Looking for a rule with intermediate file `Makef
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile.mod'.
Trying implicit prerequisite `Makefile.mod,v'.
Trying pattern rule with stem `Makefile.mod'.
Trying implicit prerequisite `RCS/Makefile.mod,
Trying pattern rule with stem `Makefile.mod'.
Trying implicit prerequisite `RCS/Makefile.mod'
Trying pattern rule with stem `Makefile.mod'.
Trying implicit prerequisite `s.Makefile.mod'.
Trying pattern rule with stem `Makefile.mod'.
Trying implicit prerequisite `SCCS/s.Makefile.m
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.sh'.
Looking for a rule with intermediate file `Makefi
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile.sh'.
Trying implicit prerequisite `Makefile.sh,v'.
Trying pattern rule with stem `Makefile.sh'.
Trying implicit prerequisite `RCS/Makefile.sh,v'
Trying pattern rule with stem `Makefile.sh'.
Trying implicit prerequisite `RCS/Makefile.sh'.
Trying pattern rule with stem `Makefile.sh'.
Trying implicit prerequisite `s.Makefile.sh'.
Trying pattern rule with stem `Makefile.sh'.
Trying implicit prerequisite `SCCS/s.Makefile.sh
No implicit rule found for `Makefile'.
Finished prerequisites of target file `Makefile'.
No need to remake target `Makefile'.
Updating goal targets....
Considering target file `project000.exe'.
File `project000.exe' does not exist.
Considering target file `main.o'.
Considering target file `main.cpp'.
Looking for an implicit rule for `main.cpp'.
Trying pattern rule with stem `main.cpp'.
Trying implicit prerequisite `main.cpp,v'.
Trying pattern rule with stem `main.cpp'.
Trying implicit prerequisite `RCS/main.cpp,v'.
Trying pattern rule with stem `main.cpp'.
Trying implicit prerequisite `RCS/main.cpp'.
Trying pattern rule with stem `main.cpp'.
Trying implicit prerequisite `s.main.cpp'.
Trying pattern rule with stem `main.cpp'.
Trying implicit prerequisite `SCCS/s.main.cpp'
Looking for a case-insensitive implicit rule f
Trying pattern rule with stem `main.cpp'.
Trying implicit prerequisite `main.cpp,v'.
Trying pattern rule with stem `main.cpp'.
Trying implicit prerequisite `RCS/main.cpp,v'.
Trying pattern rule with stem `main.cpp'.
Trying implicit prerequisite `RCS/main.cpp'.
Trying pattern rule with stem `main.cpp'.
Trying implicit prerequisite `s.main.cpp'.
Trying pattern rule with stem `main.cpp'.
Trying implicit prerequisite `SCCS/s.main.cpp'
No implicit rule found for `main.cpp'.
Finished prerequisites of target file `main.cp
No need to remake target `main.cpp'.
Finished prerequisites of target file `main.o'.
Prerequisite `main.cpp' is older than target `ma
No need to remake target `main.o'.
Finished prerequisites of target file `project000.
Must remake target `project000.exe'.
g++ -Wall main.o -o project000.exe
Putting child 0x0a020398 (project000.exe) PID 5840
Live child 0x0a020398 (project000.exe) PID 5840
Reaping winning child 0x0a020398 PID 5840
Removing child 0x0a020398 PID 5840 from chain.
Successfully remade target file `project000.exe'.

Сделать -Rrd вывод

 This program built for i686-pc-msys
Reading makefiles...
Reading makefile `Makefile'...
Updating makefiles....
Considering target file `Makefile'.
Looking for an implicit rule for `Makefile'.
Looking for a case-insensitive implicit rule for `Makefile'.
No implicit rule found for `Makefile'.
Finished prerequisites of target file `Makefile'.
No need to remake target `Makefile'.
Updating goal targets....
Considering target file `project000.exe'.
File `project000.exe' does not exist.
Considering target file `main.o'.
Considering target file `main.cpp'.
Looking for an implicit rule for `main.cpp'.
Looking for a case-insensitive implicit rule for `main.cpp'.
No implicit rule found for `main.cpp'.
Finished prerequisites of target file `main.cpp'.
No need to remake target `main.cpp'.
Finished prerequisites of target file `main.o'.
Prerequisite `main.cpp' is older than target `main.o'.
No need to remake target `main.o'.
Finished prerequisites of target file `project000.exe'.
Must remake target `project000.exe'.
g++ -Wall main.o -o project000.exe
Putting child 0x0a01a270 (project000.exe) PID 6796 on the chain.
Live child 0x0a01a270 (project000.exe) PID 6796
Reaping winning child 0x0a01a270 PID 6796
Removing child 0x0a01a270 PID 6796 from chain.
Successfully remade target file `project000.exe'.

0

Решение

Avast Antivir находился в беззвучном режиме и помещал каждый новый .exe в карантин, не уведомляя меня. Вот почему .exe был мгновенно удален после его создания.

0

Другие решения


По вопросам рекламы [email protected]