DEST	      = ../bin

EXTHDRS	      = /usr/include/stdio.h

HDRS	      = doc.h \
		global.h

LDFLAGS	      = 

CFLAGS        = -O4

LIBS	      =

#CC	      = gcc
LINKER	      = cc $(CFLAGS)

MAKEFILE      = Makefile

OBJS	      = cmdargs.o \
		fetch.o \
		init.o \
		main.o \
		output.o \
		state.o

PRINT	      = pr

PROGRAM	      = dinero

SRCS	      = cmdargs.c \
		fetch.c \
		init.c \
		main.c \
		output.c \
		state.c

$(PROGRAM):     $(OBJS) $(LIBS)
		@echo -n "Loading $(PROGRAM) ... "
		@$(LINKER) $(LDFLAGS) $(OBJS) $(LIBS) -o $(PROGRAM)
		@echo "done"

clean:;		@rm -f $(OBJS)

depend:;	@mkmf -f $(MAKEFILE) PROGRAM=$(PROGRAM) DEST=$(DEST)

index:;		@ctags -wx $(HDRS) $(SRCS)

install:	$(PROGRAM)
		@echo Installing $(PROGRAM) in $(DEST)
		@install -s $(PROGRAM) $(DEST)

print:;		@$(PRINT) $(HDRS) $(SRCS)

program:        $(PROGRAM)

tags:           $(HDRS) $(SRCS); @ctags $(HDRS) $(SRCS)

update:		$(DEST)/$(PROGRAM)

$(DEST)/$(PROGRAM): $(SRCS) $(LIBS) $(HDRS) $(EXTHDRS)
		@make -f $(MAKEFILE) DEST=$(DEST) install
###
cmdargs.o: global.h /usr/include/stdio.h
fetch.o: global.h /usr/include/stdio.h
init.o: global.h /usr/include/stdio.h
main.o: global.h /usr/include/stdio.h
output.o: global.h /usr/include/stdio.h
state.o: global.h /usr/include/stdio.h
