sbase/Makefile

73 lines
1.1 KiB
Makefile
Raw Normal View History

2011-05-23 01:36:34 +00:00
include config.mk
2011-05-27 00:20:03 +00:00
HDR = text.h util.h
2011-06-03 04:38:40 +00:00
LIB = \
util/afgets.o \
util/agetcwd.o \
util/concat.o \
util/enmasse.o \
util/eprintf.o \
util/recurse.o \
SRC = \
basename.c \
cat.c \
chmod.c \
chown.c \
date.c \
dirname.c \
echo.c \
false.c \
grep.c \
head.c \
ln.c \
ls.c \
mkdir.c \
mkfifo.c \
nl.c \
pwd.c \
rm.c \
sleep.c \
sort.c \
tail.c \
tee.c \
touch.c \
true.c \
tty.c \
uname.c \
wc.c
2011-05-27 00:20:03 +00:00
2011-05-24 12:00:30 +00:00
OBJ = $(SRC:.c=.o) $(LIB)
2011-05-23 01:36:34 +00:00
BIN = $(SRC:.c=)
MAN = $(SRC:.c=.1)
all: $(BIN)
2011-05-29 20:30:44 +00:00
$(OBJ): util.h config.mk
2011-05-24 12:00:30 +00:00
$(BIN): util.a
2011-05-27 00:20:03 +00:00
cat.o grep.o tail.o: text.h
2011-05-23 01:36:34 +00:00
.o:
2011-05-29 20:30:44 +00:00
@echo LD -o $@
@$(LD) -o $@ $< util.a $(LDFLAGS)
2011-05-23 01:36:34 +00:00
.c.o:
@echo CC -c $<
2011-05-24 12:00:30 +00:00
@$(CC) -c -o $@ $< $(CFLAGS)
util.a: $(LIB)
2011-06-01 20:31:22 +00:00
@echo AR -r $@
@$(AR) -r -c $@ $(LIB)
2011-05-23 01:36:34 +00:00
dist: clean
@echo creating dist tarball
@mkdir -p sbase-$(VERSION)
2011-05-27 00:20:03 +00:00
@cp -r LICENSE Makefile config.mk $(SRC) $(MAN) util $(HDR) sbase-$(VERSION)
2011-05-23 01:36:34 +00:00
@tar -cf sbase-$(VERSION).tar sbase-$(VERSION)
@gzip sbase-$(VERSION).tar
@rm -rf sbase-$(VERSION)
clean:
@echo cleaning
2011-05-24 12:00:30 +00:00
@rm -f $(BIN) $(OBJ) $(LIB) util.a