Added my implementation of unixtime.

This implementation has very few reasonable code (call atol() and ctime()),
but has some nice standard program stuff (parse options, print help, ...).
This commit is contained in:
heinzel
2008-02-19 14:12:59 +00:00
commit c1aa247e85
10 changed files with 582 additions and 0 deletions

72
Makefile.in Normal file
View File

@@ -0,0 +1,72 @@
# @Makefile.in@
PREFIX := @PREFIX@
BINDIR := @BINDIR@
MAN1DIR := @MAN1DIR@
MAIN := unixtime
OBJS := unixtime.o
#LIBS :=
MAN1 := unixtime.1
MANGZ := @MANGZ@
ifeq ($(MANGZ), 1)
MAN1 := $(addsuffix .gz, $(MAN1))
endif
CC := @CC@
CP := @CP@
GZIP := @GZIP@
INSTALL := @INSTALL@
RM := @RM@
STRIP := @STRIP@
TAR := @TAR@
.PHONY: help strip install install-bin install-man install-man1 uninstall \
clean distclean mrproper dist
.DEFAULT: $(MAIN)
$(MAIN): $(OBJS)
ifeq (@STATIC@, 1)
$(CC) --static -g -o $(MAIN) $(LIBS) $(OBJS)
else
$(CC) -g -o $(MAIN) $(LIBS) $(OBJS)
endif
%.o : %.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
help:
@echo "There is no help."
strip: $(MAIN)
$(STRIP) $(MAIN)
install: install-bin install-man
install-bin: strip
$(INSTALL) $(MAIN) $(BINDIR)
install-man: install-man1
install-man1: $(MAN1)
$(INSTALL) $^ $(MAN1DIR)
%.gz : %
$(GZIP) -c $< > $@
uninstall:
-$(RM) $(BINDIR)/$(MAIN)
cd $(MAN1DIR) ; -$(RM) $(MAN1)
clean:
$(RM) -f *.o $(MAIN)
distclean: clean
$(CP) Makefile.dist Makefile
mrproper: distclean
dist: distclean
cd .. ; $(TAR) -czf $(notdir $(PWD)).tar.gz $(notdir $(PWD))
#end