Skip to content

Add some additional flexibility to Make.pkg #347

@gopherbot

Description

@gopherbot

by kirklin.mcdonald:

The attached patch adds support for four new variables to Make.pkg.

Specifying the BIN variable in a Makefile that includes Make.pkg will cause 
the resulting package to be linked into a binary, with the name given by 
$BIN.

GOFLAGS allows the user to specify additional flags to pass to the 
compiler. In particular, this includes additional -I flags.

GLFLAGS allows the user to specify additional flags to the linker. This is 
a counterpart to the BIN variable, given that the $BIN rule is the only one 
which invokes $(LD). This is particularly useful for specifying a -L flag.

PREFIX permits the user to specify an alternative to GOROOT for the 
purposes of installing a package. (It more or less just GOROOT_QUOTED 
renamed.) (A separate variable from GOROOT is required for this purpose, as 
GOROOT is what permits the user's Makefile to find Make.pkg in the first 
place.)

The latter three varaibles, taken together, permit the user to create a 
directory for third-party libraries, separate from the standard library. 
Setting GOFLAGS and GLFLAGS in .bashrc allows future builds to see this 
third-party directory. Setting PREFIX at 'make install'-time installs 
packages into this directory.

Attachments:

  1. Make.pkg.diff (1994 bytes)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions