2012-05-21 00:14:49 +02:00
|
|
|
|
|
|
|
CC ?= cc
|
|
|
|
INSTALL ?= install
|
|
|
|
RM ?= rm
|
2012-06-02 10:09:16 +02:00
|
|
|
LN ?= ln
|
|
|
|
MAKE ?= make
|
|
|
|
MD ?= mkdir
|
2012-08-18 00:15:03 +02:00
|
|
|
MD_P ?= $(MD) -p
|
2012-06-02 10:09:16 +02:00
|
|
|
CP ?= cp
|
|
|
|
TAR ?= tar
|
2012-05-21 00:14:49 +02:00
|
|
|
|
|
|
|
D ?= /
|
|
|
|
PREFIX ?= /
|
|
|
|
BIN_PREFIX ?= $(PREFIX)/bin
|
|
|
|
CFLAGS ?= -Os
|
|
|
|
|
2012-06-02 10:09:16 +02:00
|
|
|
VERSION = $(shell cat VERSION)
|
|
|
|
|
2012-08-18 00:15:03 +02:00
|
|
|
help:
|
|
|
|
@echo "Choose:"
|
|
|
|
@echo "make all - build all files"
|
|
|
|
@echo "make install - install isirc"
|
|
|
|
@echo "make tarball - build source-tarball"
|
|
|
|
@echo "make clean - removes build-files"
|
|
|
|
|
2012-05-21 00:14:49 +02:00
|
|
|
all: cmdline
|
|
|
|
|
|
|
|
cmdline: cmdline.c
|
|
|
|
$(CC) $(CFLAGS) -o $@ -Dcmdline_main=main $<
|
|
|
|
|
|
|
|
install:
|
2012-08-18 00:15:03 +02:00
|
|
|
$(MD_P) $(D)/$(BIN_PREFIX)
|
2012-05-21 00:14:49 +02:00
|
|
|
$(INSTALL) -D -m 0755 cmdline $(D)/$(BIN_PREFIX)
|
|
|
|
$(INSTALL) -D -m 0744 isirc $(D)/$(BIN_PREFIX)
|
2012-06-02 10:09:16 +02:00
|
|
|
$(LN) -s bin/isirc $(D)/init
|
|
|
|
$(LN) -s bin/isirc $(D)/linuxrc
|
2012-05-21 00:14:49 +02:00
|
|
|
|
|
|
|
clean:
|
2012-08-18 00:15:03 +02:00
|
|
|
$(RM) cmdline isirc-*.tar.xz
|
2012-06-02 10:09:16 +02:00
|
|
|
|
|
|
|
tarball:
|
|
|
|
ls isirc Makefile cmdline.c | pax -s "!^!isirc-$(VERSION)/!" -w | xz > isirc-$(VERSION).tar.xz
|
2012-05-21 00:14:49 +02:00
|
|
|
|
2012-06-02 10:09:16 +02:00
|
|
|
.PHONY: all install clean tarball
|