[gameprogrammer] Re: Linux C++ compiler without a makefile

  • From: "Alan Wolfe" <atrix2@xxxxxxx>
  • To: <gameprogrammer@xxxxxxxxxxxxx>
  • Date: Sat, 24 Jul 2004 03:12:03 -0700

why are you afraid of makefiles?

well actualy i think i know...tell me if im wrong cause i had the same fear.
unneeded complexity right? all these stupid hoops to jump through when all
you want is the fricken thing to work!

my first compiler was borland C++ for dos.  awesome compiler, but i never
understood the project/makefiles and shied away from using them caus eof
their complexity (i think i opened one up one time to see what was inside
and it was gibberish but plain text).

From there i went to MSVC++ and the makefiles are binary, and wasnt really
sure what a make file did and how it related to a project file, so once
again i shied away from it.

i started working w/ sdl and dev-c++ and tried to make some cross compilable
code and realized dev-c++ didnt at the time (if it does now) support
del-config cause it couldnt execute shell scripts.

this was a problem so i asked around and was told to use msys/mingw (knowing
that mingw was what dev-c++ used).  i was like "ewww makefiles" but when
someone explained to me in 2 minutes how makefiles worked i realized just
how damn intuitive and very simple they are.  i had no idea that linux style
makefiles just make sense :P

btw msys is a bash style prompt for windows, very fun to program in.  using
msys/mingw makes it so you can really really make cross compilable code
since you can use "make" in windows/linux/mac/etc w/o having to have
seperate makefiles for each operating system/architecture.  also, you dont
have to jump through any hoops like read online docs trying to get shit to
work, it just works because it is just simple.

let's say you have these files as part of a program: main.cpp blah.cpp
blah.h

heres the makefile you would make (named makefile and in the same directory
as your code):

---Makefile start (this isnt part of the file)---
all: main.o blah.o
    g++ -o myprog.exe main.o blah.o
main.o: main.cpp blah.h
    g++ -o main.o main.cpp
blah.o: blah.cpp blah.h
    g++ -o blah.o blah.cpp
---Makefile end (also not part of the actual file)---

how you use it is go to the directory and type "make" and it will rebuild
whatever is needed and remkae the exe.  Just like compilers you are used to,
it wont rebuild object files it doesnt need to.

but lets say you didnt care about that and you just wanted it to be simple:

---Makefile start---
all: main.cpp blah.cpp blah.h
    g++ -o myprog.exe main.cpp blah.cpp
---Makefile end---

simple stuff, really.  you might want to check it out, you cant afterall go
throughout life w/o ever getting your hands dirty and learning new things!
Somethings you learn may actualy be awesome instead of cumbersome, i found
*nix style make files to be such an animal :P

alternately to makefiles, if you wanted to, you could just use the above g++
line to compile the program instead of using a makefile. ::shrug::

hope this helps!  you neednt fear, some people out there actualy make things
that are helpful, make sense and just work! (i know...its few and far
between)

feel free to ask if you have any other questions or concerns and i will do
my best to help you or atleast point you in the right direction for an
answer.

----- Original Message ----- 
From: "Kevin Jenkins" <gameprogrammer@xxxxxxxxxx>
To: <gameprogrammer@xxxxxxxxxxxxx>
Sent: Friday, July 23, 2004 10:06 PM
Subject: [gameprogrammer] Re: Linux C++ compiler without a makefile


> Let me put it a different way...
>
> I'm looking for an integrated GUI based IDE on Linux that allows me to
> create projects, add source files to a project, compile, and build
> without requiring me to write, copy, maintain, edit, or otherwise look
> at or be aware of any configuration files, including make files.
>
> Every windows compiler I know of, which is three, does this:
>
> Borland C++
> MSVC
> Dev-CPP
>
> Every linux compiler I know of, which is one, does not do this:
>
> KDevelop.
>
> Gregg Bolinger wrote:
> > g++ doesn't require a makefile or any config files.  Why would you
> > think it does?  In fact, I don't know of ANY C++ compiler that
> > REQUIRES a makefile or any config file.  All a makefile does it
> > automate what you would do by hand with the compiler anyway.
> >
> > Gregg
> >
> > On Fri, 23 Jul 2004 21:32:45 -0700, Kevin Jenkins
> > <gameprogrammer@xxxxxxxxxx> wrote:
> >
> >>I'm looking for a linux C++ compiler that does not require me to edit
> >>any configuration files, especially makefiles.  Is there such a thing?
> >>
> >>---------------------
> >>To unsubscribe go to http://gameprogrammer.com/mailinglist.html
> >>
> >>
> >
> >
> >
>
>
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>
>



---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: