question

AshaDiggi-2801 avatar image
0 Votes"
AshaDiggi-2801 asked AshaDiggi-2801 commented

initial makefile generation

Hi All,

I am trying to build the VC++ project in Eclipse IDE, so for this

I found I need to import the vc++ project as a eclipse makefile project, but before importing I need to create a initial makefile in vc++,

I found we can create makefile in vc++, following the below steps:

File->New->Project->visual C++->General->" selecting the file type makefile".

In Debug configuration asking the commands for build,clean and rebuild
So what exactly I need to specify here..

visual studio is new for me,so could you suggest me what commands I need to give...

how do I find build, rebuild and clean command in visual studio 2010?

Regards,
Asha

c++
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Sorry, I missed the part where you said VS 2010.

0 Votes 0 ·
SimpleSamples avatar image
0 Votes"
SimpleSamples answered AshaDiggi-2801 commented

Using Visual Studio 2017 I do not see General in File->New->Project->Visual C++. I do however see Other so I will assume that is what you mean. When I use that to make a Makefile project I get the following:

111074-makefileproject.jpg



makefileproject.jpg (21.1 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,

yes, you are right...

II want to know this one only,

what we need to specify for build command line,clean command line and rebuild command line?

Any simple example,please...

Regards,
Asha.

I

0 Votes 0 ·
JeanineZhang-MSFT avatar image
0 Votes"
JeanineZhang-MSFT answered AshaDiggi-2801 commented

Hi,

Support for visual studio 2010 has ended.

I suggest you could try to use Visual Studio 2017 and later. In Visual Studio 2017 and later, the Makefile project template is available when the C++ Desktop Development workload is installed.

After you create a makefile project, you can view and edit each of the build, rebuild and clean command in the Nmake page of the project's property page.

For more details I suggest you could refer to the Doc: Create a C++ makefile project

Best Regards,

Jeanine


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,

Thank you for the response,

I gone through the document.


for example :

If I am using GCC compiler for c/c++ projects then i need to compile it using the command "gcc filename.c -o filename.exe", then we will run it using the command " ./a.out" and we can clean or delete the generated exe file using the command : " rm -f filename.exe"...

In this case while generating the make file the contents are


CC=gcc

CFLAGS=-g
LDFLAGS=

SRCS=src/hello.c
OBJS = $(patsubst src/%.c,obj/%.o,$(SRCS))

.PHONY: all
all: clean build
@echo ========== Complete ==========

.PHONY: build
build: ./obj $(OBJS)
@echo ========== Build ==========
$(CC) $(LDFLAGS)-o a.exe $(OBJS)

.PHONY: run
run:
@echo ========== Run ==========
./a.exe

.PHONY: clean
clean:
@echo ========== Clean ==========
rm -f obj/*.o
rm -f a.exe

./obj:
mkdir ./obj

obj/%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@


So in the similar way what commands I need to specify in the build command line, clean command line and rebuild command line.....

Regards,
Asha.





0 Votes 0 ·