#!/usr/bin/make -f
#
# Makefile for 'hello world' example on Debian
# 
# Note that the CDL3 compiler sports several man pages,
# see e.g. man cdlc(1), cdlrts(3) and cdlfubar(7).
# Install the cdl3-doc package to get the 100+ page 
# CDL3 Reference Manual (in PostScript format)
#

CDLC = /usr/bin/cdlc
CDLFLAGS = -L /usr/share/cdl3/include/ -W
LDFLAGS = -L/usr/lib
LDLIBS = -lcdlrts -lm
SRC =	hello.k3
OBJ =	hello.o
PROG =	hello

all: test

test: $(PROG)
	./$(PROG)
	
clean:
	rm -f $(OBJ) $(PROG)

$(PROG): $(OBJ)
	$(CC) -o $@ $(LDFLAGS) $(OBJ) $(LDLIBS)

%.o: %.k3
	$(CDLC) $(CDLFLAGS) $<

%.c: %.k3
	$(CDLC) -c $(CDLFLAGS) $<

.SUFFIXES: .k3

