Brought back makefile
This commit is contained in:
parent
4a9720185b
commit
0dd39a5fac
1 changed files with 37 additions and 0 deletions
37
makefile
Executable file
37
makefile
Executable file
|
@ -0,0 +1,37 @@
|
|||
CFLAGS += -std=c99 -pedantic -g -D_XOPEN_SOURCE=700
|
||||
builddir = bin
|
||||
prefix = /usr/local
|
||||
exec_prefix = $(prefix)
|
||||
bindir = $(exec_prefix)/bin
|
||||
mandir = $(prefix)/man
|
||||
INSTALLPROGRAM = \install
|
||||
|
||||
UTILS = asa basename cat cksum cmp dirname echo expand false head link ln pwd true tty wc
|
||||
|
||||
all: $(UTILS)
|
||||
|
||||
install-strip: INSTALLPROGRAM = \install -s
|
||||
install-strip: install
|
||||
|
||||
install: installdirs
|
||||
$(INSTALLPROGRAM) $(builddir)/* $(bindir)
|
||||
$(INSTALLPROGRAM) *.1 $(mandir)
|
||||
|
||||
%: %.c bindirs
|
||||
$(CC) $(CFLAGS) -o $(builddir)/$@ $<
|
||||
|
||||
installdirs:
|
||||
if [ ! -d "$(bindir)"]; then \
|
||||
mkdir $(bindir); \
|
||||
fi
|
||||
|
||||
bindirs:
|
||||
if [ ! -d "$(builddir)" ]; then \
|
||||
mkdir $(builddir); \
|
||||
fi
|
||||
|
||||
uninstall:
|
||||
#remove utilities in $(bindir)
|
||||
|
||||
clean:
|
||||
-rm -rf $(builddir)
|
Loading…
Reference in a new issue