webdevRefinery Forum: Make file for C++ - webdevRefinery Forum

Jump to content

Think a topic deserves its own subforum?

Any topic that gets popular here will have a subforum made for it, as long as there are folks around who can answer questions! So if you think wdR is missing something, just talk about it here :)
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Rate Topic: -----

User is online Cyril 

  • Group: Members
  • Posts: 2544
  • Joined: 03-August 10
  • Expertise:HTML,CSS,PHP,Javascript,Graphics

Posted 16 May 2012 - 02:23 PM (#1)

Make file for C++


So, uh, yeah, I'm coding some C++ (Don't worry, tis something awesome that I will be posting on wdR this weekend, hopefully).
Includes printer drivers and some other fancy things.

Anyway, at the moment, I'm running the command by hand in my terminal. This is what I need to run:
g++ -o bin/file `cups-config --cflags` src/file.cpp `cups-config --libs`
cp bin/file someotherplace/file


(Obviously, I use history... Not going to type that every time :rolleyes:)

So, I was thinking that there must have been a better way, without going through an IDE (it's literally just one file, not going to open up xCode for that).
After asking Kyek... A Makefile, of course! However, I've looked around, and can't quite find a tutorial that works.

So yeah... What should the file contain, and how should I run it?

Thanks

website :: github :: twitter :: dribbble :: forrst
html, css, php, javascript, graphics
0


User is offline Kyek 

  • Founder of wdR
  • Group: Administrators
  • Posts: 5078
  • Joined: 20-February 10
  • LocationPhiladelphia, PA, USA
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 16 May 2012 - 03:02 PM (#2)

This is how I learned :D Very first link should do it for you.
1


User is online Cyril 

  • Group: Members
  • Posts: 2544
  • Joined: 03-August 10
  • Expertise:HTML,CSS,PHP,Javascript,Graphics

Posted 16 May 2012 - 03:12 PM (#3)

View PostKyek, on 16 May 2012 - 03:02 PM, said:

This is how I learned :D Very first link should do it for you.


Thanks :D

Edit: Yeah, actually:
$ make filter
make: *** No rule to make target `filter'.  Stop.


filter: src/filter/everprinter.cpp
	mkdir bin
	g++ -o bin/everprinter `cups-config --cflags` src/filter/everprinter.cpp `cups-config --libs`
	cp bin/everprinter /usr/libexec/cups/filter/everprinter


(Those are proper tabs, by the way)

website :: github :: twitter :: dribbble :: forrst
html, css, php, javascript, graphics
0


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Enter your sign in name and password


Sign in options
  Or sign in with these services