# @(#)Makefile.simple	1.18 93/06/28
# Simple Makefile for building under non-4.1 Suns.

CC = acc

SOURCES			= atom.c client.c cmdstream.c debug.c defaults.c \
			  dsdm.c environ.c error.c evbind.c events.c group.c \
			  helpsend.c i18n.c info.c kbdfuncs.c list.c mem.c \
			  menu.c moveresize.c olwm.c notice.c properties.c \
			  resources.c screen.c services.c selection.c \
			  slave.c slots.c st.c states.c usermenu.c usleep.c \
			  win.c winbusy.c winbutton.c wincolor.c winframe.c \
			  wingframe.c winicon.c winipane.c winmenu.c \
			  winnofoc.c winpane.c winpinmenu.c winpush.c \
			  winresize.c winroot.c

OBJECTS                 = ${SOURCES:.c=.o}

HEADERS                 = cmdstream.h debug.h defaults.h dsdm.h environ.h \
			  error.h events.h globals.h group.h helpcmd.h \
			  i18n.h kbdfuncs.h list.h mem.h menu.h notice.h \
			  olcursor.h ollocale.h olwm.h resources.h \
			  properties.h screen.h selection.h slots.h st.h \
			  win.h \
			  ${BITMAPS}

BITMAPS			= iconimage.h iconmask.h
MISC			= .olwmmenu Readme

# Symbols for DEFINES:
#
# -DALLPLANES		support Sun's ALLPLANES extension
# -DDEBUG		enable debugging code
# -DGPROF_HOOKS		add profiling calls
# -DOW_I18N_L3		level 3 (European language) internationalization
# -DOW_I18N_L4		level 4 (Asian language) internationalization
# -DSHAPE		support the X SHAPE (nonrect window) extension

DEFINES			= -DALLPLANES -DSHAPE

# olwm.o RubberWin.o := DEFINES += -DALLPLANES
# slave.o := DEFINES += -Dpid_t=int -DRLIMIT_NOFILE=-1

LIBRARIES               = -lolgx -lXext -lX11
OPT			= -O2
CFLAGS		       += ${OPT} -I${OPENWINHOME}/include ${DEFINES}
LDFLAGS		       += -L${OPENWINHOME}/lib

olwm: ${HEADERS} ${OBJECTS}
	$(CC) -o olwm ${OBJECTS} ${LDFLAGS} ${LIBRARIES}

# Malloc-debugging version.  Compile a debugging version, but also add
# the debugging version of malloc and turn on MALLOCDEBUG.
mdebug: debug
mdebug := OTHEROBJECTS	=   /usr/lib/debug/malloc.o
mdebug := DEFINES	+= -DMALLOCDEBUG=2

debug: olwm
debug := OPT=-g
debug := DEFINES += -DDEBUG

gprof: olwm
gprof := OPT += -pg
gprof := DEFINES += -DGPROF_HOOKS
gprof := LDFLAGS += -pg -Bstatic

tags: ${SOURCES} ${HEADERS}
	ctags -tw ${SOURCES} ${HEADERS}

clean:
	rm -f ${OBJECTS} olwm olwm-debug core *~

.KEEP_STATE:
