/*
 * Jmakefile for ewb (client)
 */

#include "../../U/runtime.H"

;# Files used to build the daemon
LSRC = eproto.c eif_in.c eif_out.c ewb_init.c ewb_dumped.c ewb_child.c ewb_transfer.c ewb_proto.c
ALL_SRC = $(LSRC)

;# Derived object file names
LOBJ = \
|expand f!$(ALL_SRC)!
	!f:\.c=.o \
-expand \\

WOBJ = \
|expand f!$(LSRC)!
	w!f:\.c=.o \
-expand \\

MT_WOBJ = \
|expand f!$(LSRC)!
	MTw!f:\.c=.o \
-expand \\

MT_LOBJ = \
|expand f!$(ALL_SRC)!
	MT!f:\.c=.o \
-expand \\


;# The following is to buiilt the multithreaded version, we creates rules to generate the MT*.o files
|expand f!$(ALL_SRC)!
MT!f:\.c=.o: !f
        $(CC) -c $(JMTCFLAGS) $? -o $@

-expand

;# Rule for compiling MTw*.o files
|expand f!$(ALL_SRC)!
MTw!f:\.c=.o: !f
        $(CC) -c $(JMTCFLAGS) -DWORKBENCH $? -o $@

-expand

;# Rule for compiling w*.o files
|expand f!$(ALL_SRC)!
w!f:\.c=.o: !f
        $(CC) -c $(JCFLAGS) -DWORKBENCH $? -o $@

-expand



;# Where shared archive is located (path and name)
LIB_SHARED = ../shared
LIB_IDR = ../../idrs

/* The following are understood by jmake to alter built-in commands */
RUN_TIME = ../../run-time
DPFLAGS = -I$(TOP) -I$(LIB_SHARED) -I$(RUN_TIME) -I$(LIB_IDR) -I$(RUN_TIME)/include
CFLAGS = $(DPFLAGS) -DEIF_IPC

NormalObjectRule()
NormalLibraryTarget(ewb,$(LSRC),$(LOBJ))
CustomLibraryTarget(wewb, $(WOBJ))
CustomLibraryTarget(mtewb, $(MT_LOBJ))
CustomLibraryTarget(mtwewb, $(MT_WOBJ))
CustomObjectTarget(wewb_proto.o)
CustomObjectTarget(MTwewb_proto.o)
DependTarget()
LintTarget()
