#
#   Makefile for the "C68 for QDOS" semaphore library
#
#   N.B.    This library is not really finished, so it is included
#           primarily for interest reasons, and in the hope that
#           someone might have a go at getting it working.
#           (or even work out what it is all about!)
#
#   Assumes that Default DATA directory is one containing source and objects

CC=cc
CFLAGS = -c -O -error=5 -warn=6 -maxerr=5

ASFLAGS = -c
CPPFLAGS = 
MAC = qmac

AS = cc
ASM = mac
LD = ld
RM = rm

I   =   ${P}INCLUDE_

.SUFFIXES : _x _s _asm _o _rel _hdr _h

OBJS =  numsem_o psem_o semaphore_o thrdterm_o thread_o


libsem_a :    ${I}semaphore_h ${OBJS} ${STDIO} libsem_o slblist
    slb -crv libsem_a libsem_o
    slb -crv -mslblist libsem_a

slblist :   $(OBJS} libsem_o
        @slb -v -Lslblist_tmp ${OBJS}
        tsort slblist_tmp >slblist
        @rm -f libsem_a slblist_tmp wlist ylist
        @slb -v -Wwlist ${STDIO} ${MOBJS} libsem_o
        @slb -v -Yylist ${MOBJS} ${STDIO} libsem_o

_x_o:
    cpp -P ${CPPFLAGS} $*_x $*_s
    ${AS} ${ASFLAGS} $*_s
    ${RM} $*_s

_x_s:
    cpp -A -dAS68 ${CPPFLAGS} $*_x $*_s

_c_o:
    ${CC} ${CFLAGS} $<

_s_o:
    ${AS} ${ASFLAGS} $<

_asm_o :
    ${MAC} $*_asm -ERRORS $*_list -BIN $*_o -NOWINDS

_hdr_h :
    packhdr $*_hdr $*_h

clean :
        @rm -fv ${OBJS} libsem_o

clobber : clean
        @rm -fv libsem_a slblist wlist ylist

#-------------------------- Header file dependencies -------------------------

${OBJS} :  ${I}semaphore_h

