Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$< make #745

Merged
merged 2 commits into from
Nov 3, 2022
Merged

$< make #745

merged 2 commits into from
Nov 3, 2022

Conversation

kaiquekandykoga
Copy link
Contributor

Apparently $< is not working propertly on FreeBSD.

[kandy@ ~/a/n]$ make install
mkdir -p /usr/local/
cp  /usr/local/
usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpsvx] source_file target_file
       cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpsvx] source_file ... target_directory
*** Error code 64

Stop.
make: stopped in /usr/home/kandy/a/n

Changing the Makefile from $< to bin/n works.

[kandy@ ~/a/n]$ freebsd-version
13.1-RELEASE

Changing the Makefile from $< to bin/n works.
Copy link
Collaborator

@shadowspawn shadowspawn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small simplification.

Thanks for fix.

Makefile Outdated
@@ -1,8 +1,8 @@
PREFIX ?= /usr/local

install: bin/n
mkdir -p $(PREFIX)/$(dir $<)
cp $< $(PREFIX)/$<
mkdir -p $(PREFIX)/$(dir bin/n)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplify the (now) hard-coded directory name:

Suggested change
mkdir -p $(PREFIX)/$(dir bin/n)
mkdir -p $(PREFIX)/bin

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is done. Thank you.

@shadowspawn
Copy link
Collaborator

For interest, $< is an automatic variable in GNU make for "the name of the first prerequisite":

The FreeBSD man page for make says:

The $@ and $< variables are more or less universally portable, as is the $(MAKE) variable.

but then does not mention $< anywhere else on the page! Perhaps less universally portable...

@shadowspawn shadowspawn changed the base branch from master to develop November 3, 2022 07:06
@shadowspawn shadowspawn added the pending release Merged into a branch for a future release, but not released yet label Nov 3, 2022
@shadowspawn shadowspawn merged commit ca8d624 into tj:develop Nov 3, 2022
@shadowspawn
Copy link
Collaborator

Thanks @kaiquekandykoga

@shadowspawn shadowspawn removed the pending release Merged into a branch for a future release, but not released yet label Nov 4, 2022
@shadowspawn
Copy link
Collaborator

Released in v9.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants