LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-12-2010, 07:52 PM   #1
macdudeosx
LQ Newbie
 
Registered: May 2006
Posts: 27

Rep: Reputation: 1
Makefile creation - how to add environment variables?


I successfully built and ran GNUstep Project Center and Gorm. I am porting a few of my applications I wrote on my mac to linux, but I can get it to build!

Every time I build, whether it is in the Terminal or in Project Center I get:
Quote:
/common.make: No such file or directory
/aggregate.make No such file or directory
/application.make No such file or directory
make: ***No rule to make target '/application.make'. Stop.
==Build terminated!==
I looked in the Makefile Project Center generates and I figured the build environment is not working for Make because the lines that fail are:
Quote:
include $(GNUSTEP_MAKEFILES)/common.make
include $(GNUSTEP_MAKEFILES)/aggregate.make
include $(GNUSTEP_MAKEFILES)/application.make
I edited my bash.bashrc file to include /usr/share/GNUstep/Makefiles/GNUstep.sh so that the specific variables like GNUSTEP_MAKEFILES point to /usr/share/GNUstep/Makefiles I know this because
Quote:
echo $GNUSTEP_MAKEFILES
/usr/share/GNUstep/Makefiles
and
Quote:
gnustep-config --variable=GNUSTEP_MAKEFILES
/usr/share/GNUstep/Makefiles
But for some reason, Make is not recognizing the environment variables, it just ignores them and points to the mount point for the make files, which is not where they are located.

I could go through the Make file and manually put in the path for every variable, but that is definitely not the way I want to go.

Any thoughts anyone?

Last edited by macdudeosx; 04-13-2010 at 03:03 PM.
 
Old 04-13-2010, 03:10 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
Does the make file alter the path at for the variable at some point? Care to post a copy?
 
Old 04-13-2010, 07:30 PM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,006

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
It appears as though it should work as I found this reference to environment variables:
Quote:
Make automatically imports environment variables as macros, so you can reference an environment variable such as PATH with the makefile expression $(PATH)
Are there any others in the file that could confirm this feature is at least working?

Last edited by grail; 04-13-2010 at 07:33 PM.
 
Old 04-13-2010, 09:07 PM   #4
macdudeosx
LQ Newbie
 
Registered: May 2006
Posts: 27

Original Poster
Rep: Reputation: 1
Right, sorry, here is the makefile, it is automatically generated by Project Center

Quote:
#
# GNUmakefile - Generated by ProjectCenter
#

include $(GNUSTEP_MAKEFILES)/common.make

#
# Application
#
VERSION = 0.1
PACKAGE_NAME = LeapYear
APP_NAME = LeapYear
LeapYear_APPLICATION_ICON =


#
# Resource files
#
LeapYear_RESOURCE_FILES = \
Resources/LeapYear.gorm \
Resources/Main.gsmarkup \
Resources/MainMenu-GNUstep.gsmarkup \
Resources/MainMenu-OSX.gsmarkup


#
# Header files
#
LeapYear_HEADER_FILES = \
AppController.h

#
# Class files
#
LeapYear_OBJC_FILES = \
AppController.m

#
# Other sources
#
LeapYear_OBJC_FILES += \
LeapYear_main.m

#
# Makefiles
#
-include GNUmakefile.preamble
include $(GNUSTEP_MAKEFILES)/aggregate.make
include $(GNUSTEP_MAKEFILES)/application.make
-include GNUmakefile.postamble
Preamble
Quote:
#
# GNUmakefile.preamble - Generated by ProjectCenter
#

# Additional flags to pass to the preprocessor
ADDITIONAL_CPPFLAGS +=

# Additional flags to pass to Objective C compiler
ADDITIONAL_OBJCFLAGS +=

# Additional flags to pass to C compiler
ADDITIONAL_CFLAGS +=

# Additional flags to pass to the linker
ADDITIONAL_LDFLAGS +=

# Additional include directories the compiler should search
ADDITIONAL_INCLUDE_DIRS +=

# Additional library directories the linker should search
ADDITIONAL_LIB_DIRS +=

# Additional GUI libraries to link
ADDITIONAL_GUI_LIBS +=
Postamble
Quote:
#
# GNUmakefile.postamble - Generated by ProjectCenter
#

# Things to do before compiling
# before-all::

# Things to do after compiling
# after-all::

# Things to do before installing
# before-install::

# Things to do after installing
# after-install::

# Things to do before uninstalling
# before-uninstall::

# Things to do after uninstalling
# after-uninstall::

# Things to do before cleaning
# before-clean::

# Things to do after cleaning
# after-clean::

# Things to do before distcleaning
# before-distclean::

# Things to do after distcleaning
# after-distclean::

# Things to do before checking
# before-check::

# Things to do after checking
# after-check::
I cannot find any reason why it should not work. Yes, I read the same stuff about make and environment variables in the make man pages, I have tried the environment override option
Quote:
make -e
but it still comes out with the same errors.

Last edited by macdudeosx; 04-13-2010 at 09:21 PM.
 
Old 04-13-2010, 09:39 PM   #5
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,006

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Ok ... so more searching I found:
Code:
#
# GNUmakefile
#
ifeq ($(GNUSTEP_MAKEFILES),)
 GNUSTEP_MAKEFILES := $(shell gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null)
endif

ifeq ($(GNUSTEP_MAKEFILES),)
  $(error You need to set GNUSTEP_MAKEFILES before compiling!)
endif
From here : http://svn.gna.org/svn/gnustep/apps/...nk/GNUmakefile

Also, generally not a good idea to post in multiple forums as the mods can get cranky about that sort of thing
http://www.linuxquestions.org/questi...issues-801384/
 
Old 04-16-2010, 10:03 PM   #6
macdudeosx
LQ Newbie
 
Registered: May 2006
Posts: 27

Original Poster
Rep: Reputation: 1
Oddly enough, I can make, compile and install Project Center from source even though it requires the path to GNUSTEP_MAKEFILES.

EDIT:
Yep, adding those lines to my makefile did get it running. I dont know why Project Center does not include them in the makefile when it generates it.

Ill have a look through P.C.'s source and see if I can compile my own version so those lines are automatically generated.

Thanks

Last edited by macdudeosx; 04-17-2010 at 12:54 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
makefile creation priyanka.g Linux - Newbie 2 06-28-2009 01:16 PM
variables in Makefile RudraB Programming 3 06-09-2008 02:44 PM
Makefile variables? xeon123 Programming 1 11-04-2007 11:19 AM
bash: random creation of multiple variables vicious1 Programming 3 04-23-2007 03:34 AM
Where do I add/delete/modify 'environment variables'? hello321_1999 Linux - Newbie 3 05-03-2006 11:41 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration