# makefile for example menu program
# This should be generated by imake, but it's not.
# sometime "soon". In the meantime, change the directories
# to suite your system.

# if using DBUG package, point this to the object files
# DBUGDIR = 

# Point this to the top of your source tree
TOP = /usr/src/X.V11R2

OBJS =	rtlmenu.o track_menu.o eventsave.o eventstack.o menu.o
SRCS =	rtlmenu.c track_menu.c eventsave.c eventstack.c menu.c
INCS =	menu.h menu.def.h menu.ext.h rtlmenu.h std_defs.h eventstack.h \
	arrow_icon.h dbug.h gray1.h null_icon.h dbug.h rtlmnu.ext.h \
	rtlmnu.opt.h

# compiler flags 
FLAGS = -g $(CFLAGS) -I$(TOP)

# if you want to use the DBUG package (and you have it around), define
# DBUGFLAG to be empty
DBUGFLAG = DBUG_OFF

rtlmenu.a : $(OBJS)
	rm -f rtlmenu.a
	ar clq rtlmenu.a $(OBJS)
	ranlib rtlmenu.a

rtlmenu.o : rtlmenu.c menu.h menu.def.h menu.ext.h rtlmenu.h std_defs.h
	 $(CC) $(FLAGS) -D$(DBUGFLAG) -c rtlmenu.c

track_menu.o : track_menu.c eventstack.h dbug.h \
		menu.def.h menu.h menu.ext.h null_icon.h \
		arrow_icon.h std_defs.h
	 $(CC) $(FLAGS) -D$(DBUGFLAG) -c track_menu.c

eventsave.o : eventsave.c eventstack.h dbug.h std_defs.h
	 $(CC) $(FLAGS) -D$(DBUGFLAG) -c eventsave.c

eventstack.o : eventstack.c eventstack.h dbug.h std_defs.h
	 $(CC) $(FLAGS) -D$(DBUGFLAG) -c eventstack.c

menu.o : menu.c arrow_icon.h gray1.h menu.def.h menu.h std_defs.h dbug.h
	 $(CC) $(FLAGS)   -D$(DBUGFLAG) -c menu.c

clean:
	rm -f *.o *.a core *~ #* 

noident:
	@echo Removing ident lines from menus...
	@for i in $(SRCS) $(INCS); do \
	sed -e '/#ident/D' < $$i > /tmp/x.$$i && \
	mv /tmp/x.$$i $$i ; \
	done
