Makefile includes and shell environment during compile


 
Thread Tools Search this Thread
Top Forums Programming Makefile includes and shell environment during compile
Prev   Next
# 1  
Old 10-27-2010
Makefile includes and shell environment during compile

Below is the top of my Makefile. On one machine, I have mysql_config5, and another, I have mysql_config. In my .bashrc file of one UNIX machine, I added an alias so that that mysql_config5 is mysql_config, however, when I do make, it doesn't use that environment and I get compile errors, unless I manually change the makefile.

Code:
CC              := g++
INCLUDES        := ${shell mysql_config --include}
LIBS            := ${shell mysql_config --libs}
DEBUG           := -ggdb3 -Wall

How do I know which shell Make is using? And how can I control the environment variables/commands?

I also apologize if this post belongs in the shell part of the forum, but its relevant to compiling C++ so I thought its also good to post here.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Error when run makefile to compile C program

I have a make file for C program, which always gives the error ld: 0711-738 ERROR: Input file ../src/file_name.o XCOFF32 object files are not allowed in 64 mode Does anybody know the problem? Thanks for contribution (2 Replies)
Discussion started by: digioleg54
2 Replies

2. Shell Programming and Scripting

using a Shell Script in a Makefile

Hello, I have a Makefile that converts wrl (vrml) files to html files... how can I use a shell script in that makefile which works on all html files after converting? The Shell Script have to find and replace a String in every createt html file. sorry I'm a Newbie, so I hope someone can... (0 Replies)
Discussion started by: Dan_78
0 Replies

3. Programming

Makefile + #includes

Dear all I try to write a makefile for my code which have many source files, 1 header file that i make and exist into same folder with other source files and some other header files (by libraries witch i use) that found in other folders. In my header file i have put all other #includes for... (3 Replies)
Discussion started by: panou
3 Replies

4. UNIX for Dummies Questions & Answers

change makefile environment variables

this is my first post so Hello, here is my question @top level Makefile should not set values for environment variables FC, CC, FFLAGS (etc) but use the ones that mpi_make sets. So as you can see i have to run an mpi program, in fortran and i am supposed to do the above.the program was... (3 Replies)
Discussion started by: Kwstas
3 Replies

5. Shell Programming and Scripting

compile a shell script

How can i compile a KSH shell script. I Dont want to execute it. I just need to compile it . Any Help sincerly appreciated. (5 Replies)
Discussion started by: panyam
5 Replies

6. Shell Programming and Scripting

Shell script makefile

Is there a way to write a makefile for all the source files in a directory with a shell script? (2 Replies)
Discussion started by: zzhan
2 Replies

7. Shell Programming and Scripting

shell script in makefile

Hi, Can we execute a shell script by makefile. I mean we will write a shell script in a make file and it will be executed when we compile the C++ program using make file. (2 Replies)
Discussion started by: surjyap
2 Replies

8. Shell Programming and Scripting

Setting environment variables in Makefile

I've seen a few other threads like this, but they either went unanswered or failed to answer my question. How do I set an environment variable in a Makefile? What I'm trying to do is use GNU make to automate an ant build. In order to run ant, I've got to first set a few environment... (1 Reply)
Discussion started by: Bags
1 Replies

9. Programming

How to compile and run C++ programs in UNIX environment?

:( :confused: Does anybody here know how to compile and run C++ programs in UNIX enviroment? I am so confused. Any help on this would be greatly appreciated! Thanks! (5 Replies)
Discussion started by: Kahuashi
5 Replies

10. Programming

I have not c compile environment ,i can download it but it ends with *.gz,so i can't

I need for help . (1 Reply)
Discussion started by: dsun5
1 Replies
Login or Register to Ask a Question
caspar-typesetting(7)						  MISCELLANEOUS 					     caspar-typesetting(7)

  NAME
      caspar-typesetting - Makefile snippets for common typesetting tasks

  SYNOPSIS
      In a Makefile, write

	include caspar/mk/docbook.mk

      or

	include caspar/mk/pod.mk

      .

  DESCRIPTION
      The  caspar  docbook.mk  and pod.mk files are Makefile snippets for common typesetting tasks, like typesetting LaTeX (see [3]), DocBook XML,
      DocBook SGML (see [2]) and POD (see [1]) documents.  You just have to type make, instead of stuff  like  jade  -t  tex  -d  caspar/print.dsl
      /usr/share/sgml/declaration/xml.dcl foobar.dbx.

  USAGE
      In a directory where you maintain .dbx (Docbook XML) or .tex (LaTeX) files, do

	 $ echo include caspar/mk/docbook.mk > Makefile

	 $ vi karenina.dbx
	 $ make karenina.view
	 $ make karenina.print

	 $ vi svejk.tex
	 $ make svejk.view
	 $ make svejk.print

	 $ make
	 $ make clean

      Other targets: filename.ps, filename.pdf, filename.2ps, filename.html, filename.printbig, filename.dvi.

      Variables  you  might  like  to  set  in	your  Makefile:  XMLDCL (default is /usr/share/sgml/declaration/xml.dcl; if you're not on a Debian
      GNU/Linux system, you'll likely have to adjust this), HTML_DSL, PRINT_DSL.

      In a directory where you maintain .pod files, do

	 $ echo include caspar/mk/pod.mk > Makefile
	 $ vi lire.pod
	 $ perldoc ./lire.pod
	 $ make lire.pdf
	 $ make
	 $ less lire.overstrike-txt
	 $ make clean

      Other targets: filename.ps, filename.html, filename.txt, ...  (Similar to the ones supplied by docbook.mk).

  EXAMPLES
      Some examples: Overriding the caspar-supplied DSSSL files: Create your own print.dls and html.dsl, in the same directory as your Docbook XML
      files. Your Makefile should read:

       PRINT_DSL = print.dsl
       HTML_DSL = html.dsl
       include caspar/mk/docbook.mk

      Overriding the standard html-to-text convertor:

       $ W3M=lynx make svejk.txt

      .

  FILES
      caspar/mk/docbook.mk, caspar/mk/pod.mk

  ENVIRONMENT
      For  docbook.mk: files: XMLDCL, HTML_DSL, PRINT_DSL; utilities: JADE, PDFJADETEX, PDFLATEX, JADETEX, LATEX, W3M, DVIPS, PSNUP, LPR, GV; set-
      tings: JADE_MAXERRORS. These variables can get adjusted in Makefile, as well as in the shell environment.

      pod.mk Uses no environment variables.

  AUTHOR
      Joost van Baal-Ili

  SEE ALSO
      caspar(7) [1] perlpod(1) about Perl's Plain Old Documentation format

      [2] DocBook: The Definitive Guide on http://docbook.org/,

      [3] The LaTeX Project Homepage on http://www.latex-project.org/.

      Some comments on advanced usage are in the files docbook.mk and pod.mk itself.

  caspar-typesetting 20120508					      8 mai 2012					       caspar-typesetting(7)