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

Add a more sensible install target in Makefile #939

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

tleedjarv
Copy link
Contributor

Provide a basic install target. Not intended to work on Windows but should work on most POSIX-y systems that have a BSD- or GNU-compatible install.

@gdt could you review if this works for packagers?

Makefile Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated
@@ -37,16 +37,42 @@ clean:
$(MAKE) -C man clean
$(MAKE) -C src clean

INSTALL=install
INSTALL_PROGRAM=$(INSTALL)
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe a 755? maybe that's defined by default, and can be skipped, but if that's what we mean, it's a nice declaration of intent that makes this easier to understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would go after examples from some common projects. Any suggestions as to what those might be?

Makefile Outdated
install: all
$(INSTALL) -d "$(DESTDIR)$(bindir)"
ifneq ($(wildcard src/unison),)
$(INSTALL_PROGRAM) src/unison "$(DESTDIR)$(bindir)/unison"
Copy link
Collaborator

Choose a reason for hiding this comment

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

bindir is not mkdir -d'd. I know that sounds funny, but I think it's normal to install a program into its own prefix for testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

$(INSTALL) -d on line 54 is supposed to do that here. (Also tested precisely as you describe.)

Copy link
Collaborator

@gdt gdt left a comment

Choose a reason for hiding this comment

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

Unsaid in micro comments is that this seems otherwise fine.

@tleedjarv
Copy link
Contributor Author

Rebased and updated. Now all variables should be env-able. In fact, variables from env will override GNU-style lowercase variables.

@jhjourdan
Copy link
Contributor

jhjourdan commented Feb 5, 2024

Is there anything blocking this PR? Should we merge?

It seems like no reviewer raised any issue, and, as far as I can tell, the target is doing what is needed ;)

Also, this PR is a dependency for #845, which I'm trying to push.

@gdt
Copy link
Collaborator

gdt commented Feb 5, 2024

I tested on NetBSD and was able to control PREFIX and MANDIR from the environment, so I'm now ok with this.

@gdt gdt merged commit fad3d18 into bcpierce00:master Feb 5, 2024
@tleedjarv tleedjarv deleted the makefile-install branch February 5, 2024 18:51
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.

3 participants