I am trying to run make after downloading source for lua, but I am getting an error that says
'C:/Program' is not recognized as an internal or external command,
operable program or batch file
make: *** [guess] Error 1
I understand that some people got this error due to not placing any quotation marks around the path, but right now I am just running make without specifying any path. How should I go around this?
---EDIT--
This is the makefile I tried to run
# Makefile for installing Lua
# See doc/readme.html for installation and customization instructions.
# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
# Your platform. See PLATS for possible values.
PLAT= guess
# Where to install. The installation starts in the src and doc directories,
# so take care if INSTALL_TOP is not an absolute path. See the local target.
# You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with
# LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
INSTALL_TOP= /usr/local
INSTALL_BIN= '$(INSTALL_TOP)/bin'
INSTALL_INC= '$(INSTALL_TOP)/include'
INSTALL_LIB= '$(INSTALL_TOP)/lib'
INSTALL_MAN= '$(INSTALL_TOP)/man/man1'
INSTALL_LMOD= '$(INSTALL_TOP)/share/lua/$V'
INSTALL_CMOD= '$(INSTALL_TOP)/lib/lua/$V'
# How to install. If your install program does not support "-p", then
# you may have to run ranlib on the installed liblua.a.
INSTALL= install -p
INSTALL_EXEC= $(INSTALL) -m 0755
INSTALL_DATA= $(INSTALL) -m 0644
#
# If you don't have "install" you can use "cp" instead.
# INSTALL= cp -p
# INSTALL_EXEC= $(INSTALL)
# INSTALL_DATA= $(INSTALL)
# Other utilities.
MKDIR= mkdir -p
RM= rm -f
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
# Convenience platforms targets.
PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris
# What to install.
TO_BIN= lua luac
TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
TO_LIB= liblua.a
TO_MAN= lua.1 luac.1
# Lua version and release.
V= 5.4
R= $V.2
# Targets start here.
all: $(PLAT)
$(PLATS) help test clean:
#cd src && $(MAKE) $#
install: dummy
cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
uninstall:
cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN)
cd src && cd $(INSTALL_INC) && $(RM) $(TO_INC)
cd src && cd $(INSTALL_LIB) && $(RM) $(TO_LIB)
cd doc && cd $(INSTALL_MAN) && $(RM) $(TO_MAN)
local:
$(MAKE) install INSTALL_TOP=../install
# make may get confused with install/ if it does not support .PHONY.
dummy:
# Echo config parameters.
echo:
#cd src && $(MAKE) -s echo
#echo "PLAT= $(PLAT)"
#echo "V= $V"
#echo "R= $R"
#echo "TO_BIN= $(TO_BIN)"
#echo "TO_INC= $(TO_INC)"
#echo "TO_LIB= $(TO_LIB)"
#echo "TO_MAN= $(TO_MAN)"
#echo "INSTALL_TOP= $(INSTALL_TOP)"
#echo "INSTALL_BIN= $(INSTALL_BIN)"
#echo "INSTALL_INC= $(INSTALL_INC)"
#echo "INSTALL_LIB= $(INSTALL_LIB)"
#echo "INSTALL_MAN= $(INSTALL_MAN)"
#echo "INSTALL_LMOD= $(INSTALL_LMOD)"
#echo "INSTALL_CMOD= $(INSTALL_CMOD)"
#echo "INSTALL_EXEC= $(INSTALL_EXEC)"
#echo "INSTALL_DATA= $(INSTALL_DATA)"
# Echo pkg-config data.
pc:
#echo "version=$R"
#echo "prefix=$(INSTALL_TOP)"
#echo "libdir=$(INSTALL_LIB)"
#echo "includedir=$(INSTALL_INC)"
# Targets that do not create files (not all makes understand .PHONY).
.PHONY: all $(PLATS) help test clean install uninstall local dummy echo pc
# (end of Makefile)
Related
I want
I am trying to compile some latex that has snippets of python code and the output of those snippets. I need the document to be always updated with the last changes made in the snippets and in their outputs, so the idea is maintain a makefile that could monitor this changes and generate the updated outputs.
So if I modify the file a/11.py, I want make to execute it to generate a new output a/11.out.
I have
This is my makefile
DOC=myPdf
STY=st
PY_DIR=a/
TEX=pdflatex -shell-escape -interaction=batchmode -file-line-error
$(DOC).pdf: $(PY_DIR)11.out $(PY_DIR)12.out $(DOC).tex $(STY).sty
$(TEX) $(DOC).tex
$(PY_DIR)11.out:
$(cd PY_DIR && python3 11.py > 11.out)
$(PY_DIR)12.out:
$(cd PY_DIR && python3 12.py > 12.out)
.PHONY: clean
clean:
rm *.aux *.log > /dev/null 2>&1
I wonder
Even when the file a/11.out doesn't exist, and I instruct make a/11.out make says: make: 'a/11.out' is up to date. (I am still learning make, so I probably have more mistakes).
I saw
Make in subfolder, but because I am not using $(MAKE), I cannot use it.
Similar question, but I don't think it is the same.
Thank you for your time :)
Update
This is my new version, based in the answer of Renaud (thanks for your help), some python scripts are intended to output text (xxxt.py), and others to plot images (xxxi.py), so there is no redirection for them:
DOC :=myPdf
STY :=st
PY_DIR :=a/
TEX :=pdflatex -shell-escape -interaction=batchmode -file-line-error
PYS := $(wildcard $(PY_DIR)*.py)
OUTS := $(patsubst %.py,%.out,$(PYS))
.PHONY: all clean
all: $(DOC).pdf
%.pdf: %.tex $(STY).sty $(OUTS)
$(TEX) $<
$(PY_DIR)%.out: $(PY_DIR)%t.py
cd $(PY_DIR) && python3 $*t.py > $*.out
$(PY_DIR)%.png: $(PY_DIR)%i.py
cd $(PY_DIR) && python3 $*i.py
clean:
rm *.aux *.log > /dev/null 2>&1
The directory looks like this:
./st.sty
./myPdf.tex
./myPdf.pdf
./a/11t.py
./a/11.out
./a/12i.py
./a/12.png
./a/21t.py
./a/...
However, now right after modifying myPdf.tex, make says make: Nothing to be done for 'all'.
What am I doing wrong?
Your recipes are wrong. Make expands the recipes before passing them to the shell. As there is no make variable named cd PY_DIR && python3 11.py > 11.out, $(cd PY_DIR && python3 11.py > 11.out) expands as the empty string and make considers that there is nothing to do for $(PY_DIR)11.out. Just write your recipes as plain shell (and fix the other bug with the unexpanded PY_DIR):
$(PY_DIR)11.out:
cd $(PY_DIR) && python3 11.py > 11.out
$(PY_DIR)12.out:
cd $(PY_DIR) && python3 12.py > 12.out
Note: if you want make to re-run the recipes when your python scripts change you should let him know that the output files depend on the python scripts. The best is probably to use a pattern rule instead of one specific rule per file:
$(PY_DIR)%.out: $(PY_DIR)%.py
cd $(PY_DIR) && python3 $*.py > $*.out
($* is a make automatic variable, it expands as the stem of the pattern).
A few more improvements:
You could ask make to find alone the python scripts, compute the names of the output files and store all this in make variables that you can used in your other rules.
You can use a pattern rule for the xx.tex -> xx.pdf process. And use another make automatic variable for it: $< that expands as the first prerequisite.
DOC := myPdf
STY := st
PY_DIR := a/
TEX := pdflatex -shell-escape -interaction=batchmode -file-line-error
PYS := $(wildcard $(PY_DIR)*.py)
OUTS := $(patsubst %.py,%.out,$(PYS))
.PRECIOUS: $(OUTS)
.PHONY: all clean
all: $(DOC).pdf
%.pdf: %.tex $(OUTS) $(STY).sty
$(TEX) $<
$(PY_DIR)%.out: $(PY_DIR)%.py
cd $(PY_DIR) && python3 $*.py > $*.out
.PHONY: clean
clean:
rm *.aux *.log > /dev/null 2>&1
Note: I declared $(OUTS) as precious such that make does not delete them when it is done with the building of $(DOC).pdf.
Update with the new specifications and separated python scripts for xx.out and xx.png production:
DOC := myPdf
STY := st
PY_DIR := a
TEX := pdflatex -shell-escape -interaction=batchmode -file-line-error
PYTS := $(wildcard $(PY_DIR)/*t.py)
PYIS := $(wildcard $(PY_DIR)/*i.py)
OUTS := $(patsubst $(PY_DIR)/%t.py,$(PY_DIR)/%.out,$(PYTS))
PNGS := $(patsubst $(PY_DIR)/%i.py,$(PY_DIR)/%.png,$(PYIS))
.PRECIOUS: $(OUTS) $(PNGS)
.PHONY: all clean
all: $(DOC).pdf
%.pdf: %.tex $(STY).sty $(OUTS) $(PNGS)
$(TEX) $<
$(PY_DIR)/%.out: $(PY_DIR)/%t.py
cd $(PY_DIR) && python3 $*t.py > $*.out
$(PY_DIR)/%.png: $(PY_DIR)/%i.py
cd $(PY_DIR) && python3 $*i.py
clean:
rm -f *.aux *.log > /dev/null 2>&1
Notes:
I slightly modified the definition of PY_DIR such that, when used in other parts of the Makefile, it is clear that it is a directory path. Just a matter of taste, I guess.
I added the -f option to your clean recipe such that it doesn't fail if the files to delete do not exist.
Update:
As noted by MadScientist in a comment, using $* is less generic than referring to the target ($#) and the prerequisite ($<). But as we are operating not directly on them but on their directory ($(PY_DIR)) and base file names (xx[it].py, xx.out, xx.png), switching from $* to other, more generic, automatic variables is not that simple.
But make has some more tricks that can help here: $#, $<... have variants ($(#F), $(#D)...) that expand to just the directory part or the file part. Note that, according the GNU make manual:
These variants are semi-obsolete in GNU make since the functions dir
and notdir can be used to get a similar effect.
Anyway, if we wanted to avoid $* here is what we could use instead:
$(PY_DIR)/%.out: $(PY_DIR)/%t.py
cd $(#D) && python3 $(<F) > $(#F)
$(PY_DIR)/%.png: $(PY_DIR)/%i.py
cd $(#D) && python3 $(<F)
Or (modern version):
$(PY_DIR)/%.out: $(PY_DIR)/%t.py
cd $(dir $#) && python3 $(notdir $<) > $(notdir $#)
$(PY_DIR)/%.png: $(PY_DIR)/%i.py
cd $(dir $#) && python3 $(notdir $<)
I have problem to install SEISMIC UNIX on my Ubuntu 16.04.I have followed tutorial instructions
make install
By answering you agree to abide by the terms and conditions of
the above LEGAL STATEMENT ?[y/n]y
touch: cannot touch 'LICENSE_43R1_ACCEPTED': Permission denied
Makefile:66: recipe for target 'LICENSE_43R1_ACCEPTED' failed
make: *** [LICENSE_43R1_ACCEPTED] Error 1
My makefile
#
# Makefile for the CWP/SU free software distribution
#
# Please read Makefile.config and make the necessary changes there
# then type: make install to install the standard CWP/SU codes
# make xtinstall to install X-toolkit codes
# make finstall to install Fortran codes
# make mglinstall to install Mesa/Open GL codes
# make xminstall to install X-Motif codes (optional)
# make sfinstall to install SFIO materials and SEGDREAD
#
# or if remaking:
# type: make remake to remake the standard CWP/SU codes
# make xtremake to remake X-toolkit codes
# make fremake to remake Fortran codes
# make mglremake to remake Mesa/Open GL codes
# make xmremake to remake X-Motif codes
# make sfremake to install SFIO materials and SEGDREAD
#
# Note: SEGDREAD is the program for reading SEG-D format tapes
#
# Additional items are included in: cwputils
# to compile:
# make utils
#
# Do not try to install all of the codes at one time via:
# % make install ; make xtinstall ; make xminstall
# If you get an error message about not finding /src/Makefile.config
# the explicitly define your CWPROOT path on the next line
#CWPROOT =
include $(CWPROOT)/src/Makefile.config
donothing: # To protect against an idle "make" to "see what happens"
#echo ""
#echo "This is a dangerous makefile--so the default is do_nothing"
#echo "Please read and edit Makefile.config appropriately"
#echo "then type: make install (to install the basic set of codes)"
#echo " make xtinstall (to install the X-toolkit applications)"
#echo " make finstall (to install the Fortran codes)"
#echo " make mglinstall (to install the Mesa/ Open GL items)"
#echo " make utils (to install libcwputils) (nonessential) "
#echo " make xminstall (to install the Motif application)"
#echo " make sfinstall (to install the SFIO version of SEGDREAD)"
#echo ""
#echo "or if remaking:"
#echo "type: make remake (to remake the basic set of codes)"
#echo " make xtremake (to remake the X-toolkit applications)"
#echo " make fremake (to install the Fortran codes)"
#echo " make mglremake (to install the Mesa/ Open GL items)"
#echo " make uremake (to remake libcwputils.a)(nonessential)"
#echo " make xmremake (to remake the Motif-based applications)"
#echo " make sfinstall (to remake the SFIO version of SEGDREAD)"
#echo " "
#echo "See the README_ files in ./Portability for more information."
install: checkroot LICENSE_43R1_ACCEPTED MAILHOME_43 makedirs cwpstuff plot sustuff tristuff tetrastuff compstuff reflstuff
xtinstall: xtcwp_
xminstall: xmcwp_
mglinstall: mglstuff
# automatic mail message (ask once)
LICENSE_43R1_ACCEPTED :
#./license.sh
#touch $#
# automatic mail message (ask once)
MAILHOME_43 :
#./mailhome.sh
#touch $#
# check to see if the CWPROOT path is set
checkroot :
#./chkroot.sh
#echo $(CWPROOT)
# Make the bin/include/lib directories if not already there
makedirs:
#echo "Making necessary directories"
#./mkdirectories.sh
cwpstuff:
cd ./cwp; $(MAKE)
cd ./par; $(MAKE)
plot :
cd ./psplot; $(MAKE)
sustuff :
cd ./su ; $(MAKE)
xtcwp_ :
cd ./Xtcwp; $(MAKE)
cd ./xplot; $(MAKE)
cd ./xtri; $(MAKE)
xmcwp_ :
cd ./Xmcwp; $(MAKE)
complex :
cd ./Complex; $(MAKE)
utils :
cd ./cwputils; $(MAKE)
tristuff:
cd ./tri; $(MAKE)
cd ./Trielas; $(MAKE)
tetrastuff:
cd ./tetra; $(MAKE)
compstuff:
cd ./comp; $(MAKE)
reflstuff:
cd ./Refl ; $(MAKE)
mglstuff:
cd ./Mesa; $(MAKE)
finstall:
cd ./Fortran; $(MAKE)
sfinstall:
cd ./Sfio; $(MAKE)
remake :
#./chkroot.sh
cd ./cwp; $(MAKE) remake
cd ./par; $(MAKE) remake
cd ./psplot; $(MAKE) remake
cd ./su/include; $(MAKE) remake
cd ./su; $(MAKE) remake
cd ./tri; $(MAKE) remake
cd ./tetra; $(MAKE) remake
cd ./comp; $(MAKE) remake
cd ./Refl; $(MAKE) remake
xtremake :
cd ./Xtcwp; $(MAKE) remake
cd ./xplot; $(MAKE) remake
cd ./xtri; $(MAKE) remake
xmremake :
cd ./Xmcwp; $(MAKE) remake
mglremake:
cd ./Mesa; $(MAKE) remake
uremake:
cd ./cwputils; $(MAKE) remake
tremake:
cd ./tri; $(MAKE) remake
compmake:
cd ./comp; $(MAKE) remake
fremake:
cd ./Fortran; $(MAKE) remake
sfremake:
cd ./Sfio; $(MAKE) remake
If I try as a root
root#milenko-HP-Compaq-6830s:/opt/cwp/43R1/src# make install
Makefile:32: /src/Makefile.config: No such file or directory
make: *** No rule to make target '/src/Makefile.config'. Stop.
How to solve this?
You do not have necessary permissions for that file. Most probably your install need root permissions. Try
sudo make install
The error is caused because the user you logged-in doesn't have appropriate permissions to do this, so do it with sudo or su
sudo make install
or you can first switch as root user and then fire the command:
su
make install
Apologize in advance, I am a newbie in Linux and these stuffs.
I have to install rApache 1.2.0, but when I write on the terminal:
make -f ~/Makefile.am
it gives me many errors, such as:
make: *** No rule to make target "mod_R.h", needed by "mod_R.so".
or
make: *** No rule to make target "#DOCROOT#/httpd.conf.in", needed by "#DOCROOT#/httpd.conf".
Here is the Makefile.am (link):
# DARWIN has to be different than everyone else
# and define their autoconf $shlibpath_var to be DYLD_LIBRARY_PATH
SHLIBPATH_VAR=#SHLIBPATH_VAR#
ACLOCAL_AMFLAGS = -I m4
APXS=#APXS#
HTTPD=#HTTPD#
DOCROOT=#DOCROOT#
APREQ=#APREQ#
APREQ_COMPILE=#APREQ_COMPILE#
APREQ_INSTALL=#APREQ_INSTALL#
APREQ_CLEAN=#APREQ_CLEAN#
APREQ_LIB_DIR=#APREQ_LIB_DIR#
APREQ_INCLUDES=#APREQ_INCLUDES#
APREQ_LINKLD=#APREQ_LINKLD#
RPROG=#RPROG#
RPROGBATCH=R_DEFAULT_PACKAGES=NULL #RPROG# --vanilla --no-readline --slave -f
R_HOME = `$(RPROG) RHOME`
R_LD_LIBRARY_PATH = $(R_HOME)/lib
RINCLUDES=#RINCLUDES#
RLINKLD=#RLINKLD#
INCLUDES = $(RINCLUDES) $(APREQ_INCLUDES)
LDFLAGS = $(RLINKLD) $(APREQ_LINKLD)
LD_LIBRARY_PATH=$(R_LD_LIBRARY_PATH):$(APREQ_LIB_DIR)
RPATH=#RPATH#
all: mod_R.so $(DOCROOT)/httpd.conf
mod_R.so: .apreq-config mod_R.c mod_R.h
#echo
#echo Compiling mod_R
#echo
$(APXS) $(INCLUDES) -c mod_R.c $(RPATH) $(LDFLAGS)
.apreq-config:
#echo
#echo Configuring libapreq2
#echo
$(APREQ_COMPILE)
touch .apreq-config
install: all
$(APXS) -i -n R mod_R.la
$(APREQ_INSTALL)
$(DOCROOT)/httpd.conf: $(DOCROOT)/httpd.conf.in
$(RPROGBATCH) tools/config_http.R --args $(APXS) $(HTTPD)
itest: all
#echo
#echo Point your browser to http://localhost:8181/index.html
#echo
$(SHLIBPATH_VAR)=$(LD_LIBRARY_PATH) R_HOME=$(R_HOME) $(HTTPD) -X -f $(DOCROOT)/httpd.conf
test: all $(DOCROOT)/httpd.conf
stop: all
$(SHLIBPATH_VAR)=$(LD_LIBRARY_PATH) R_HOME=$(R_HOME) $(HTTPD) -X -f $(DOCROOT)/httpd.conf -k stop
valgrind: all
$(SHLIBPATH_VAR)=$(LD_LIBRARY_PATH) R_HOME=$(R_HOME) valgrind $(HTTPD) -X -f $(DOCROOT)/httpd.conf
debug: all
#echo
#echo Copy/paste the following line to gdb
#echo
#echo run -X -f $(DOCROOT)/httpd.conf
#echo
$(SHLIBPATH_VAR)=$(LD_LIBRARY_PATH) R_HOME=$(R_HOME) gdb $(HTTPD)
clean:
rm -rf $(OBJS) core mod_R.o mod_R.so *~ .libs *.o *.slo *.lo *.la .apreq-config
$(APREQ_CLEAN)
distclean: clean
rm -rf mod_R.h Makefile .depend .install libtool config.log config.status test/httpd.conf test/access_log test/error_log test/httpd.pid test/accept.lock* aclocal.m4 autom4te.cache libapreq2/library/t/Makefile libapreq2/config.nice libapreq2/module/apache/Makefile
$(APREQ_CLEAN)
Any help would be greatly appreciated.
Thanks, Sho
makefile.am is a template for autotools
makefile.am -> automake -> makefile.in
makefile.in -> autoconf -> Makefile
There must be an INSTALL or a README file.
Generally commands are
./configure
make
make test
make install
try ./configure --help for options (--prefix if you are not admin)
I have a makefile from a sample project that tries to reference the parent directory as "../bin". This does not seem to work when running "make install". The error I get is:
cp: cannot stat `/bin/build/*': No such file or directory
The layout of the project is:
/bin
/src/makefile
(So when I run the makefile, the current directory is /src/)
It appears referencing the parent directory with ".." is incorrect. I know I can reference the current directory with {$CURDIR} variable, but I need to know the proper variable or way to reference the parent directory so /bin/ is referenced correctly. I think I might be able to work around this by moving the makefile, but I want to know the real way to do this for future use.
The makefile looks like this (problem ares highlighted with ##### problem ######)
# The name of the extension.
extension_name := xulschoolhello
# The UUID of the extension.
extension_uuid := helloworld#xulschool.com
# The name of the profile dir where the extension can be installed.
profile_dir := 8mtbjosv.development
# The zip application to be used.
ZIP := zip
# The target location of the build and build files.
bin_dir := ../bin ##### problem ######
# The target XPI file.
xpi_file := $(bin_dir)/$(extension_name)2.xpi
# The type of operating system this make command is running on.
os_type := $(patsubst darwin%,darwin,$(shell echo $(OSTYPE)))
# The location of the extension profile.
ifeq ($(os_type), darwin)
profile_location := \
~/Library/Application\ Support/Firefox/Profiles/$(profile_dir)/extensions/\{$(extension_uuid)\}
else
ifeq ($(os_type), linux-gnu)
profile_location := \
~/.mozilla/firefox/$(profile_dir)/extensions/
else
profile_location := \
"$(subst \,\\,$(APPDATA))\\Mozilla\\Firefox\\Profiles\\$(profile_dir)\\extensions\\{$(extension_uuid)}"
endif
endif
# The temporary location where the extension tree will be copied and built.
build_dir := $(bin_dir)/build ##### problem ######
# This builds the extension XPI file.
.PHONY: all
all: $(xpi_file)
#echo
#echo "Build finished successfully."
#echo
# This cleans all temporary files and directories created by 'make'.
.PHONY: clean
clean:
#rm -rf $(build_dir)
#rm -f $(xpi_file)
#echo "Cleanup is done."
# The sources for the XPI file.
xpi_built := install.rdf \
chrome.manifest \
$(wildcard content/*.js) \
$(wildcard content/*.xul) \
$(wildcard content/*.xml) \
$(wildcard content/*.css) \
$(wildcard skin/*.css) \
$(wildcard skin/*.png) \
$(wildcard locale/*/*.dtd) \
$(wildcard locale/*/*.properties)
$(build_dir) $(xpi_built): $(xpi_built)
# This builds everything except for the actual XPI, and then it copies it to the
# specified profile directory, allowing a quick update that requires no install.
.PHONY: install
install: $(build_dir) $(xpi_built)
#echo "Installing in profile folder: $(profile_location)"
#cp -Rf $(build_dir)/* $(profile_location) ##### problem ######
#echo "Installing in profile folder. Done!"
#echo
$(xpi_file): $(xpi_built)
#echo "Creating XPI file."
#$(ZIP) $(xpi_file) $(xpi_built)
#echo "Creating XPI file. Done!"
I am using GNU Make 3.81 on Linux Mint 12.
Thanks.
Output of
#echo "Installing in profile folder: $(profile_location)"
#echo ${build_dir}
#echo ${profile_location}
is :
Installing in profile folder: ~/.mozilla/firefox/8mtbjosv.development/extensions/
../bin/build
/home/owner/.mozilla/firefox/8mtbjosv.development/extensions/
I think you should try to check that the destination folder, $(profile_location), exists and that it is writable. Also, make sure that the line endings have the proper Linux format (\n). I'm not able to spot any other error at the moment.
What if it is running so that ../bin is relative to where the makefile is, but not where it is running? If make clean works, then it's a sign that might be the case. Look for some compiler options to give verbose output, then put a "pwd" statement there to see how it resolves.
Not a direct answer but when trying to reference the parent directory in a command using GNU Make 4.2.1 I found that I had to escape the forward slash...
backup:
#tar -czvpf ..\/$(PROGRAM)-`date +'%Y%m%d%H%M'`.tar.gz $(FILES)
How can I distinguish in makefile, which targets and how(when) they are called internally? I have a makefile with number of targets which are actually variables.
UPD: here is an example
build_dir := $(bin_dir)/build
xpi_built := $(build_dir)/$(install_rdf) \
$(build_dir)/$(chrome_manifest) \
$(chrome_jar_file) \
$(default_prefs)/*
xpi_built_no_dir := $(subst $(build_dir)/,,$(xpi_built))
.PHONY: install
install: $(build_dir) $(xpi_built)
#echo "Installing in profile folder: $(profile_location)"
#cp -Rf $(build_dir)/* $(profile_location)
#echo "Installing in profile folder. Done!"
#echo
$(xpi_file): $(build_dir) $(xpi_built)
#echo "Creating XPI file."
#cd $(build_dir); $(ZIP) -r ../$(xpi_file) $(xpi_built_no_dir)
#echo "Creating XPI file. Done!"
#cp update.rdf $(bin_dir)/
#cp -u *.xhtml $(bin_dir)/
#cp -Rf $(default_prefs) $(build_dir)/; \
$(build_dir)/%: %
cp -f $< $#
$(build_dir):
#if [ ! -x $(build_dir) ]; \
then \
mkdir $(build_dir); \
fi
If you specify a target on the command line, as in make clean Make will attempt to build that target. If you don't (that is, if you just run make), Make will attempt to build the default target; the default target is the first target in the makefile (in your case install) unless you set it to something else with the .DEFAULT_GOAL variable.
When Make tries to build a target, it first builds that target's prerequisites, if necessary. (When is it necessary? When a target is a file or directory that does not exist real (unless it's .PHONY, but that's an advanced topic), or when one of it's prerequisites is newer than the target (unless it's "order-only", but that's an advanced topic)). So if Make is trying to build your all, it will first try to build $(build_dir) and $(xpi_built), which have been defined elsewhere in the makefile.
If you're trying to figure out what Make will do and when, there are tricks you can use. For example, you can run make -n, and Make would tell you what it would do, instead of doing it. Or you can put a command like #echo now making $# in a rule, to tell you what it's doing. Or for even more information:
some_target: preq another_preq and_another
#echo Making $#. The prerequisites are $^. Of those, $? are newer than $#.
other_commands...