CC		= gcc
CPP		= $(CC) -E
CFLAGS		= -funsigned-char -O2 -Ddplinux #-DNO_SHELL
LD		= $(CC)
LDFLAGS		=  
LIBS		=
DEFS		=

.c.o:
	$(CC) $(CFLAGS) -c $<

HDRS		= misc_os.h \
		  filesys.h \
		  box.h \
                  box_file.h \
                  box_mem.h \
                  box_send.h \
                  box_sf.h \
                  box_sub.h \
                  box_sys.h \
		  box_tim.h \
		  boxglobl.h \
		  boxlocal.h \
		  box_inou.h \
		  box_serv.h \
		  boxbcast.h \
		  boxfserv.h \
		  yapp.h \
		  crc.h \
		  dpglobal.h \
		  huffman.h \
		  pastrix.h \
		  sort.h \
		  tools.h \
                  init.h \
                  dpbox.h \
                  ifacedef.h \
		  status.h \
		  shell.h \
		  defs.h

OBJS		= \
		  misc_os.o \
		  filesys.o \
		  box.o \
                  box_mem.o \
                  box_send.o \
                  box_sf.o \
                  box_sub.o \
                  box_sys.o \
		  box_tim.o \
		  boxglobl.o \
		  boxlocal.o \
		  box_inou.o \
		  box_serv.o \
		  boxbcast.o \
		  boxfserv.o \
		  yapp.o \
		  crc.o \
		  dpglobal.o \
		  huffman.o \
		  pastrix.o \
		  sort.o \
                  box_file.o \
		  tools.o \
		  status.o \
		  shell.o \
                  init.o \
		  main.o 

SRCS		= \
		  misc_os.c \
		  filesys.c \
		  box.c \
                  box_file.c \
                  box_mem.c \
                  box_send.c \
                  box_sf.c \
                  box_sub.c \
                  box_sys.c \
		  box_tim.c \
		  boxglobl.c \
		  boxlocal.c \
		  box_inou.c \
		  box_serv.c \
		  boxbcast.c \
		  boxfserv.c \
		  yapp.c \
		  crc.c \
		  dpglobal.c \
		  huffman.c \
		  pastrix.c \
		  sort.c \
		  tools.c \
		  status.c \
		  shell.c \
                  init.c \
		  main.c

OTHERS          = Makefile \
		  dpbox.ini.smpl \
		  MAKE_DIFF \
		  NCFILES \
		  P2CDIFF

all:		dpbox

tgz:
		@echo Creating dpboxsrc.tgz
		@tar -cvzf dpboxsrc.tgz $(SRCS) $(HDRS) $(OTHERS)

csource:	$(SRCS)

dpbox:		$(OBJS)
		$(CC) $(CFLAGS) $(OBJS) $(LIBS) -o dpbox;

clean:
	rm -f  *.o *~ .*~ dpbox .depend

dep:
	$(CPP) -M $(SRCS) > .depend

#
# include a dependency file if one exists
#
ifeq (.depend,$(wildcard .depend))
include .depend
endif
