我的makefile代码出了什么问题?

时间:2014-04-15 04:50:44

标签: unix makefile

我有一个我需要改变的makefile,并用它来安装程序。我可以弄清楚为什么我会收到这个错误:

v245-2% make install
install -m 555 audit /export/home/student/scort323/bin
sh: install: not found
*** Error code 1
make: Fatal error: Command failed for target `install'

以下是我的代码,有人可以给我一些建议。我不擅长makefile,所以试图找到这个错误对我来说很难,直到我得到更好的理解:

# Make file for audit
# Location to install binary. Default is /usr/local/bin. You may
# prefer to install it in /usr/bin or /sbin
BINDIR  = /export/home/student/scort323/bin
#BINDIR=/usr/bin
#BINDIR=/usr/sbin

# Location to install man page. Default is /usr/local/man. You may
# prefer to install it in /usr/man
MANDIR  = /export/home/student/scort323/bin
#MANDIR = /usr/man

# Compiler to use
CC      = gcc

# Linker to use
LD      = gcc

# Preprocessor options
CPPFLAGS = -DGETOPTLONG

# Compile and link options
# On a.out systems you might want to add -N when linking
# RPM_OPT_FLAGS can be set by rpm tool
# ...For production code
CFLAGS  = -Wall -O3 $(RPM_OPT_FLAGS)
LDFLAGS = -s
# ...For debug
#CFLAGS = -Wall -g
#LDFLAGS = -g

audit:  audit.o
    $(LD) $(LDFLAGS) -o audit audit.o

audit.o: audit.c
    $(CC) $(CPPFLAGS) $(CFLAGS) -c audit.c

install: audit
    install -m 555 audit $(BINDIR)
#/audit
    install -m 444 audit.1 $(MANDIR)
#/man1/audit.1

clean:
    $(RM) audit audit.o core *~ results

# check in
ci:     clean
    -ci -l *

dist:   clean
    cd .. ; tar --exclude RCS -czvf audit-0.2.tar.gz audit-0.2

1 个答案:

答案 0 :(得分:0)

makefile没有问题。检查您是否有安装实用程序

$ ~install --help

如果你没有,那么你可以从GNU coreutils获得它。如果您已在某处安装,则在PATH变量中导出其路径

export PATH = $ PATH:/ path / to / install-utilit