# make[1]: cannot open Makefile.



## Clockwork (Dec 25, 2022)

I want to try to make a port for my program that I recently drew in tcl.

I will optimize the program code, so do not laugh.

I've read the FreeBSD Porter Handbook but haven't figured out exactly what the problem is.

Can anyone tell me what I'm doing wrong?

Makefile:

```
# $FreeBSD$

PORTNAME=          sndy
PORTVERSION=    1.0.0
CATEGORIES=       sysutils

MAINTAINER=     Clockwork@FreeBSD.org
COMMENT=        PROGRAM FOR SOUND SWITCHING IN FreeBSD.
WWW=                 https://github.com/Clockwork6400/sndy

LICENSE=             BSD2CLAUSE
LICENSE_FILE=   LICENSE

NO_BUILD=         yes

RUN_DEPENDS=   tcl86>=8.6.12:lang/tcl86 \
                tk86>=8.6.12:x11-toolkits/tk86

PLIST_FILES=    bin/sndy.tcl

USE_GITHUB=     yes
GH_ACCOUNT=     Clockwork6400
GH_TAGNAME=     abfbce63

.include <bsd.port.mk>
```

On the `make stage` I am getting the following error:


```
===>  License BSD2CLAUSE accepted by the user
===>   sndy-1.0.0 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by sndy-1.0.0 for building
===>  Extracting for sndy-1.0.0
=> SHA256 Checksum OK for Clockwork6400-sndy-1.0.0-abfbce63_GH0.tar.gz.
===>  Patching for sndy-1.0.0
===>  Configuring for sndy-1.0.0
===>  Staging for sndy-1.0.0
===>   Generating temporary packing list
make[1]: cannot open Makefile.

make[1]: stopped in /usr/ports/sysutils/sndy/work/sndy-abfbce63
*** Error code 2

Stop.
make: stopped in /usr/ports/sysutils/sndy
```


----------



## cracauer@ (Dec 25, 2022)

You seem to mix tabs and space in Makefile? Try tabs only.


----------



## jmos (Dec 25, 2022)

There is nothing to compile as Tcl is a script language. You may check these options:

RUN_DEPENDS=    tclsh8.6:lang/tcl86
USES=           tk:8.6
NO_BUILD=       yes
NO_ARCH=        yes

Note that I'm using Tk as "USE" (and not as run dependency) - your code will only depend on the Tcl- or the Tk-interpreter (there's just one line in your code thet defines the interpreter), and the interpreter is the RUN-dependency.


----------



## Clockwork (Dec 25, 2022)

jmos said:


> There is nothing to compile as Tcl is a script language. You may check these options:
> 
> RUN_DEPENDS=    tclsh8.6:lang/tcl86
> USES=           tk:8.6
> ...


I followed your advice but it didn't help. By adding these dependencies to your makefile. I am having the same error.


```
===>  License BSD2CLAUSE accepted by the user
===>   sndy-1.0.0 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by sndy-1.0.0 for building
===>  Extracting for sndy-1.0.0
=> SHA256 Checksum OK for Clockwork6400-sndy-1.0.0-abfbce63_GH0.tar.gz.
===>  Patching for sndy-1.0.0
===>   sndy-1.0.0 depends on shared library: libtk86.so - found (/usr/local/lib/libtk86.so)
===>   sndy-1.0.0 depends on shared library: libtcl86.so - found (/usr/local/lib/libtcl86.so)
===>  Configuring for sndy-1.0.0
===>  Staging for sndy-1.0.0
===>   sndy-1.0.0 depends on executable: tclsh8.6 - found
===>   Generating temporary packing list
make[1]: cannot open Makefile.

make[1]: stopped in /usr/ports/sysutils/sndy/work/sndy-abfbce63
*** Error code 2

Stop.
make: stopped in /usr/ports/sysutils/sndy
```


----------



## Clockwork (Dec 25, 2022)

cracauer@ said:


> You seem to mix tabs and space in Makefile? Try tabs only.


No. I just did not immediately understand the markup on the forum, if I understand you correctly.


----------



## yuripv79 (Dec 25, 2022)

Override the do-install target, taking STAGEDIR into consideration (and generally read porters handbook, https://docs.freebsd.org/en/books/porters-handbook/special/#staging).


----------



## jmos (Dec 25, 2022)

Update:


```
PORTNAME=    sndy
PORTVERSION=    1.0.0
CATEGORIES=    sysutils

MAINTAINER=    Clockwork@FreeBSD.org
COMMENT=    PROGRAM FOR SOUND SWITCHING IN FreeBSD
WWW=        https://github.com/Clockwork6400/sndy

LICENSE=    BSD2CLAUSE
LICENSE_FILE=    ${WRKSRC}/LICENSE

RUN_DEPENDS=    tcl86>=8.6.12:lang/tcl86 \
        tk86>=8.6.12:x11-toolkits/tk86

NO_BUILD=     yes

PLIST_FILES=    bin/sndy.tcl

USE_GITHUB=    yes
GH_ACCOUNT=    Clockwork6400
GH_TAGNAME=    abfbce63

do-install:
    ${INSTALL_SCRIPT} ${WRKSRC}/sndy.tcl ${STAGEDIR}${PREFIX}/bin

.include <bsd.port.mk>
```

Don't forget to do the recommended checks the porters handbook suggests.


----------



## Clockwork (Dec 25, 2022)

jmos said:


> Update:
> 
> ```
> ...
> ...


Thanks a lot, this works for me.
All checks were successful. However, in the `portlint` step, I get the following statement.


```
FATAL: Makefile: [1]: $FreeBSD$ is deprecated in Git.
Found 1 fatal error and 0 warnings.
```


----------



## SirDice (Dec 25, 2022)

Remove that first line: `# $FreeBSD$`


----------



## Clockwork (Dec 25, 2022)

SirDice said:


> Remove that first line: `# $FreeBSD$`


Thanks, I was just about to ask.


----------



## Clockwork (Dec 25, 2022)

SirDice said:


> ``


I have the following question. You don't know how to get the shar of a port?

If I understand correctly, the manual says to go to the directory above and type `shar find oneko > oneko.shar`

But when I do this I get `find inaccessible or not exist` and an empty sndy.shar file


----------



## yuripv79 (Dec 26, 2022)

Clockwork said:


> If I understand correctly, the manual says to go to the directory above and type `shar find oneko > oneko.shar`


Which "manual"? Porters handbook says the following in https://docs.freebsd.org/en/books/porters-handbook/quick-porting/:

```
Example 2. Creating a .shar for a New Port
go to the directory above where the port directory is located, and use tar to create the shar archive:
% cd ..
% tar cf oneko.shar --format shar oneko
```
If you mean shar(1), it says:

```
shar `find . -print`
```
(You can skip `-print` primitive as it's default).


----------

