sbase/Makefile

38 lines
752 B
Makefile
Raw Normal View History

2011-05-23 01:36:34 +00:00
include config.mk
2011-05-24 12:00:30 +00:00
LIB = util/enmasse.o util/eprintf.o
2011-05-24 20:39:20 +00:00
SRC = basename.c cat.c date.c dirname.c echo.c false.c grep.c ln.c pwd.c rm.c \
sleep.c tee.c touch.c true.c wc.c
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)
$(OBJ): util.h
2011-05-24 12:00:30 +00:00
$(BIN): util.a
2011-05-23 01:36:34 +00:00
.o:
@echo CC -o $@
2011-05-24 12:00:30 +00:00
@$(CC) -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)
@echo AR rc $@
@$(AR) rc $@ $(LIB)
2011-05-23 01:36:34 +00:00
dist: clean
@echo creating dist tarball
@mkdir -p sbase-$(VERSION)
@cp LICENSE Makefile config.mk $(SRC) $(MAN) util.c util.h sbase-$(VERSION)
@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