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

<bsd.progs.mk>: Allow using SRCS for common sources #766

Closed
wants to merge 1 commit into from

Conversation

VexedUXR
Copy link
Contributor

@VexedUXR VexedUXR commented Jun 5, 2023

Instead of having to do:

PROGS=	program1 program2
SRCS.program1=	program1.c common.c
SRCS.program2=	program2.c common.c

This can now be done instead:

PROGS=	program1 program2
SRCS=	common.c
SRCS.program1=	program1.c
SRCS.program2=	program2.c

This shouldn't effect any existing projects using <bsd.progs.mk>.

Signed-off-by: Ahmad Khalifa ahmadkhalifa570@gmail.com

Edit: Add Signed-off-by

Instead of having to do:

PROGS=	program1 program2
SRCS.program1=	program1.c common.c
SRCS.program2=	program2.c common.c

This can now be done instead:

PROGS=	program1 program2
SRCS=	common.c
SRCS.program1=	program1.c
SRCS.program2=	program2.c

This shouldn't effect any existing projects using <bsd.progs.mk>.
@VexedUXR VexedUXR requested review from bsdimp and bapt as code owners June 5, 2023 18:02
@igalic
Copy link
Contributor

igalic commented Jun 11, 2023

cc @sgerraty

@bsdimp
Copy link
Member

bsdimp commented Jun 11, 2023

I'm unsure. This is likely good, but we've also discouraged .progs use. I'm learning towards approving. It looks good, but this is well into make magic and I'm unsure what it might break. I think nothing, but om unsure

@sgerraty
Copy link
Contributor

I've not looked at what has been done to bsd.progs.mk recently, but contrib/bmake/mk/progs.mk already allows what the description above appears to want. So given this change would appear to bring it back closer to the original, don't imagine it would break anything, but you'd have to ask the folk who made the changes introducing PROG_OVERRIDE_VARS

@sgerraty
Copy link
Contributor

After looking at some of the history of bsd.progs.mk I would note that the diffs would be much easier to follow if the variable lists used the one per line format

@VexedUXR
Copy link
Contributor Author

Alright, so the only edge case I found was that something like this is valid only when SRCS is in PROG_OVERRIDE_VARS

PROGS=	program1 program2
SRCS=	common.c
SRCS.program1=	program1.c common.c
SRCS.program2=	program2.c common.c

With these changes this obviously produces a duplicate symbol error, however I dont see why someone using progs.mk would do this.

the diffs would be much easier to follow if the variable lists used the one per line format

As for this, should I commit this in this PR?

@sgerraty
Copy link
Contributor

sgerraty commented Jun 29, 2023 via email

@bsdimp
Copy link
Member

bsdimp commented Jul 7, 2023

@sgerraty you ok with this? I kinda think you are (but have suggestions for follow on work), but wanted to make sure before I push it.

@sgerraty
Copy link
Contributor

@sgerraty you ok with this? I kinda think you are (but have suggestions for follow on work), but wanted to make sure before I push it.

Yes I'm ok with it, and yes my other comments were for future work

@bsdimp
Copy link
Member

bsdimp commented Dec 28, 2023

Great! Pushed in. Thanks for the submission and reviews everybody!

@bsdimp bsdimp closed this Dec 28, 2023
freebsd-git pushed a commit that referenced this pull request Dec 28, 2023
Instead of having to do:

PROGS=	program1 program2
SRCS.program1=	program1.c common.c
SRCS.program2=	program2.c common.c

This can now be done instead:

PROGS=	program1 program2
SRCS=	common.c
SRCS.program1=	program1.c
SRCS.program2=	program2.c

This shouldn't effect any existing projects using <bsd.progs.mk>.

Reviewed by: imp, sjg
Pull Request: #766
@VexedUXR VexedUXR deleted the patch-1 branch December 30, 2023 17:54
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Mar 13, 2024
Instead of having to do:

PROGS=	program1 program2
SRCS.program1=	program1.c common.c
SRCS.program2=	program2.c common.c

This can now be done instead:

PROGS=	program1 program2
SRCS=	common.c
SRCS.program1=	program1.c
SRCS.program2=	program2.c

This shouldn't effect any existing projects using <bsd.progs.mk>.

Reviewed by: imp, sjg
Pull Request: freebsd/freebsd-src#766
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants