touch: cannot touch 'LICENSE_43R1_ACCEPTED': Permission denied - makefile

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

Related

use DKMS to install realtek r8125 driver, get No rule to make target 'CLEAN'

I try to use dkms to install realtek r8125 driver.
The official driver autorun script use this to compile source code
make $# all 1>>log.txt || exit 1
the top level makefile is
KFLAG := 2$(shell uname -r | sed -ne 's/^2\.[4]\..*/4/p')x
all: clean modules install
modules:
ifeq ($(KFLAG),24x)
$(MAKE) -C src/ -f Makefile_linux24x modules
else
$(MAKE) -C src/ modules
endif
clean:
ifeq ($(KFLAG),24x)
$(MAKE) -C src/ -f Makefile_linux24x clean
else
$(MAKE) -C src/ clean
endif
install:
ifeq ($(KFLAG),24x)
$(MAKE) -C src/ -f Makefile_linux24x install
else
$(MAKE) -C src/ install
endif
my dkms.conf is
PACKAGE_NAME="realtek-r8125"
PACKAGE_VERSION="9.009.01"
MAKE="'make' $# all"
CLEAN="'make' clean"
BUILT_MODULE_NAME[0]="r8125"
BUILT_MODULE_LOCATION[0]="src"
DEST_MODULE_LOCATION[0]="/kernel/driver/net/ethernet/realtek"
AUTOINSTALL="yes"
REMAKE_INITRD=no
when I build this project, I get an error
make: *** No rule to make target 'CLEAN'. Stop.
when I change dkms.conf like this
PACKAGE_NAME="realtek-r8125"
PACKAGE_VERSION="9.009.01"
MAKE="'make' all"
CLEAN="'make' clean"
BUILT_MODULE_NAME[0]="r8125"
BUILT_MODULE_LOCATION[0]="src"
DEST_MODULE_LOCATION[0]="/kernel/driver/net/ethernet/realtek"
AUTOINSTALL="yes"
REMAKE_INITRD=no
it run success
why DKMS say "No rule to make target 'CLEAN'" even if there is a clean target in makefile
what is the difference between make all and make $# all

makefile "C:\Program" not recognized as internal or external command

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)

Configure Make to fail immediately with bad target

I am launching multiple builds of a verilog compiler using Make. I am only using Make to take advantage of the -j flag. My file looks something like this
allfpga: fpga0 fpga1 fpga2 fpga3 fpga4 fpga5 fpga6
fpga0:
cd fpgas/$(#)/build && $(MAKE)
fpga1:
cd fpgas/$(#)/build && $(MAKE)
fpga2:
cd fpgas/$(#)/build && $(MAKE)
fpga3:
cd fpgas/$(#)/build && $(MAKE)
fpga4:
cd fpgas/$(#)/build && $(MAKE)
fpga5:
cd fpgas/$(#)/build && $(MAKE)
fpga6:
cd fpgas/$(#)/build && $(MAKE)
And I invoke one of make -j2 allfpga or make -j2 fpga0 fpag3 fpga5 fpga6
However if there is a typo (such as in the command I gave fpag3), in the second make target, the system will happily spend minutes building, and then stop early.
My question, how can I get make to stop initially if some of the targets are not real ones?
There's no good way to get make to "pre-screen" all your requested targets. Make can't know if a target is buildable until it tries to build it (for example it could be created based on some other target using a pattern rule or something).
However, you could do something like this:
ALLFPGAS := fpga0 fpga1 fpga2 fpga3 fpga4 fpga5 fpga6
# Get any command line goal which is not one of ALLFPGAS
unknown := $(filter-out $(ALLFPGAS),$(MAKECMDGOALS))
# If there are any, bail!
$(if $(unknown),$(error Unknown FPGA: $(unknown)))
allfpga: $(ALLFPGAS)
$(ALLFPGAS):
cd fpgas/$#/build && $(MAKE)
.PHONY: allfpga $(ALLFPGAS)

no rule to make target but file exists, compiling

I can't seem to debug this, could someone please help? The *.f90 file does exists and the directory is correct. I am not sure what it could be, the gfortran compiler works fine outside of the makefile.
make[1]: Entering directory '/media/f/fv/ED-2.1/ED/build/bin'
make[1]: *** No rule to make target 'media/f/fv/ED-2.1/ED/src/utils/allometry.f90', needed by 'allometry.o'. Stop.
make[1]: Leaving directory '/media/f/fv/ED-2.1/ED/build/bin'
Makefile:24: recipe for target 'all' failed
This is the makefile
#----- Define path and compilation --------------------------------------------------------#
include paths.mk
include include.mk.$(OPT)
#----- Compiler commands. -----------------------------------------------------------------#
INCLUDES = $(PAR_INCS) -I$(ED_INCS) $(HDF5_INCS) $(MPI_INCS)
F90_COMMAND = $(F_COMP) -c $(F_OPTS) $(INCLUDES) $(PAR_DEFS)
FPP_COMMAND = $(F_COMP) -c -DUSE_INTERF=$(USE_INTERF) -DUSENC=$(USENC) -D$(CMACH) \
-DUSE_HDF5=$(USE_HDF5) -DUSE_COLLECTIVE_MPIO=$(USE_COLLECTIVE_MPIO) \
-DUSE_MPIWTIME=$(USE_MPIWTIME) $(F_OPTS) $(INCLUDES) $(PAR_DEFS)
CXX_COMMAND = $(C_COMP) -c $(C_OPTS) -D$(CMACH) $(HDF5_INCS) $(INCLUDES) $(PAR_DEFS)
#----- Define archive and executable names. -----------------------------------------------#
EXE=$(BASE)/ed_$(ED_VERSION)-$(OPT)
LIBMODEL=$(BASE)/ed_$(ED_VERSION)-$(OPT).a
include objects.mk
#----- Define targets. --------------------------------------------------------------------#
all:
make gendep
#$(info $$EXE is [${EXE}])
make $(EXE)
make $(EXE)
make $(EXE)
make $(EXE)
make $(EXE)
gendep:
#echo ""
./generate_deps.sh $(ED_ROOT)
#echo === Finished dependencies ===
$(EXE): $(LIBMODEL) $(MAINOBJ)
#echo ""
$(LOADER) -o $(EXE) edmain.o $(LOADER_OPTS) $(LIBMODEL) $(HDF5_LIBS) $(PAR_LIBS) \
$(NC_LIBS) $(LIBS) $(LOADER_OPTS)
#echo ""
#echo Finished building === $(EXE)
#echo ""
$(MAINOBJ): $(MAIN)
#echo ""
cp -f $< $(<F:.f90=.f90)
$(F90_COMMAND) $(<F:.f90=.f90)
rm -f $(<F:.f90=.f90)
$(LIBMODEL): $(OBJ_MODEL)
$(ARCHIVE) $(LIBMODEL) $(OBJ_MODEL)
FORCE:
install:
#echo ""
ln -fs `pwd`/$(EXE) ../run/$(BASE)
ln -fs `pwd`/$(EXE) ../test/$(BASE)
#echo ""
clean:
#echo ""
rm -f $(LIBMODEL) $(EXE) *.o *.mod *.F90 *.f90 *.stb *.d dependency.mk
rm -f ../$(EXE) ../$(LIBMODEL)
touch dependency.mk
#echo ""
#----- Define rules -----------------------------------------------------------------------#
include rules.mk
This makefile is a hot mess. Why do you have the same command make $(EXE) listed 5 times in a row in the all recipe? Why are you using $(<F:.f90=.f90) which just replaces the string .f90 with an identical string .f90, essentially a no-op?
Further, we don't have enough information here to answer your question: you haven't provided the definition of the variables MAINOBJ or OBJ_MODEL, or more importantly, MAIN. At least one of those is wrong. Unless you've mis-transcribed the error message (please always cut and paste actual errors, don't try to manually type them in!!), then this:
make[1]: *** No rule to make target 'media/f/fv/ED-2.1/ED/src/utils/allometry.f90', needed by 'allometry.o'. Stop.
tells you what the problem is; note there is no slash (/) at the beginning of this pathname, before media. So this is not an absolute path, it's a relative path. That means make is actually trying to find the file named /media/f/fv/ED-2.1/ED/build/bin/media/f/fv/ED-2.1/ED/src/utils/allometry.f90 which clearly won't exist.
We can't tell you why this is happening because you haven't provided the information about how these variables are set. Most likely the bad one is MAIN but it's hard to know for sure.

makefile internal calls to target

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...

Resources