# BuildSystemHeader added automatically
# $Header: [makefile_merged.,v 1.2 91/06/05 15:03:42 afuller Exp ]$
DESTDIR =
 
CDEBUGFLAGS = -O
DEFINES = -DDWTUNIX
INCLUDES = -I$(DESTDIR)/usr/include/X11 -I$(DESTDIR)/usr/include
CFLAGS = $(CDEBUGFLAGS) $(DEFINES) $(INCLUDES)
 
XLIB = $(DESTDIR)/usr/lib/libX11.a
DWTLIB = $(DESTDIR)/usr/lib/libdwt.a
LIBS = /usr/lib/fortrtl.a $(DWTLIB) $(XLIB) -lc
 
CC = vcc
LK = lk
 
PROGRAM = dxcalendar
 
DATABASE_HEADERS = \
		dwc_db_private_include.h \
		dwc_db_public_include.h \
		dwc_db_public_structures.h \
		dwc_db_record_structures.h \
		dwc_db_work_structures.h \
		dwc_messages.h
 
DATABASE_OBJS = \
		dwc_db_calendar_maintenance.o \
		dwc_db_create_calendar.o \
		dwc_db_day_items.o \
		dwc_db_day_management.o \
		dwc_db_day_mapping.o \
		dwc_db_error_handling.o \
		dwc_db_open_close.o \
		dwc_db_physical_records.o \
		dwc_db_profile_management.o \
		dwc_db_repeat_expressions.o \
		dwc_db_virtual_buffers.o \
		dwc_db_alarms.o
 
HELP_HEADERS = \
		help_support.h
 
HELP_OBJS = \
		help_support_cs.o
 
HELP_LIBRARY = \
		Aboutframe.hlp \
		CSH.hlp \
		Glossary.hlp \
		Overview.hlp

UI_HEADERS = \
		dwc_ui_basics.h \
		dwc_ui_calendar.h \
		dwc_ui_dateformat.h \
		dwc_ui_datestructures.h \
		dwc_ui_errorboxes.h \
		dwc_ui_help.h \
		dwc_ui_monthinfo.h \
		dwc_ui_monthwidgetprivate.h \
		dwc_ui_monthwidgetpublic.h \
		dwc_ui_rendition.h \
		dwc_ui_stretchwidgetprivate.h \
		dwc_ui_timebar.h \
		dwc_ui_timeslots.h \
		dwc_ui_yeardisplay.h \
		layout.h
 
UI_OBJS = \
		dwc_ui_calendar.o \
		dwc_ui_dateformat.o \
		dwc_ui_datefunctions.o \
		dwc_ui_errorboxes.o \
		dwc_ui_help.o \
		dwc_ui_monthinfo.o \
		dwc_ui_monthwidget.o \
		dwc_ui_print.o \
		dwc_ui_rendition.o \
		dwc_ui_stretchwidget.o \
		dwc_ui_timebar.o \
		dwc_ui_timeslots.o \
		dwc_ui_yeardisplay.o \
		dwc_ui_icons.o \
		layout.o \
		popupboxposition.o		
 
VMS_OBJS = \
		dwc_test_vmsnames.o \
		sysgetmsg.o
 
 
all: $(PROGRAM) dwcmsg

dwc_ui_calendar.o: dwc_ui_calendar.c
	$(CC) -c $(CFLAGS) dwc_ui_calendar.c
	mv dwc_ui_calendar.o main_dwc_ui_calendar.o
	$(CC) -c $(CFLAGS) -DCOMBINE dwc_ui_calendar.c

libcalendar.a: $(DATABASE_OBJS) $(HELP_OBJS) $(UI_OBJS)
	rm -rf libcalendar.a
	ar cr libcalendar.a \
		$(DATABASE_OBJS) \
		$(HELP_OBJS) \
		$(UI_OBJS)
	ranlib libcalendar.a
 
$(PROGRAM): libcalendar.a
	$(LK) -K -t -o $(PROGRAM) \
		/usr/lib/fortinitial.o \
		main_dwc_ui_calendar.o \
		libcalendar.a \
		$(VMS_OBJS) \
		$(LIBS)
 
dbx_cal:
	make "CDEBUGFLAGS = -g" DESTDIR=$(DESTDIR) $(PROGRAM)
 
dwcmsg:
	$(LK) -t -o dwcmsg dwc_messages.o sysmsg.o libmsg.o
 
#	install -c -s -m 755 $(PROGRAM) $(DESTDIR)/usr/bin
install: all
	install -c -s -m 755 dwcmsg $(DESTDIR)/usr/lib
	install -c -m 644 Calendar $(DESTDIR)/usr/lib/X11/app-defaults
	-mkdir $(DESTDIR)/usr/lib/help
	-mkdir $(DESTDIR)/usr/lib/help/Calendar
	install -c -m 644 Aboutframe.hlp $(DESTDIR)/usr/lib/help/Calendar/Aboutframe
	install -c -m 644 CSH.hlp $(DESTDIR)/usr/lib/help/Calendar/CSH
	install -c -m 644 Glossary.hlp $(DESTDIR)/usr/lib/help/Calendar/Glossary
	install -c -m 644 Overview.hlp $(DESTDIR)/usr/lib/help/Calendar/Overview
 
clean:
	rm -f $(DATABASE_OBJS) $(HELP_OBJS) $(UI_OBJS) core *.a $(PROGRAM)
