/*
 * Jmakefile for bench specific information
 */

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

;# Files used to build the daemon
LSRC = byte.c minilzo.c
PSTORE = pstore.c pretrieve.c

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

MT_FOBJ = \
|expand f!$(LSRC) $(PSTORE)!
	MT!f:\.c=.o \
-expand \\

/*
 * Object files for workbench archive
 */
WOBJ = \
|expand f!$(LSRC)!
	!f:\.c=.o \
-expand
|expand f!$(PSTORE)!
	w!f:\.c=.o \
-expand \\

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

/* How to build a 'w' file from a normal file. The library for the workbench
 * is built from w*.c files, which are linked from normal files. Dependencies
 * for w*.c files will be strong enough to force recompilation of a w*.o if the
 * original .o was to be rebuilt.
 * Same for the multithreaded files.
 */

|expand f!$(PSTORE)!
w!f:\.c=.o: !f
        $(CC) -c $(JCFLAGS) -DWORKBENCH $? -o $@

-expand

|expand f!$(LSRC) $(PSTORE)!
MT!f:\.c=.o: !f
        $(CC) -c $(JMTCFLAGS) $? -o $@

-expand

|expand f!$(PSTORE)!
MTw!f:\.c=.o: !f
        $(CC) -c $(JMTCFLAGS) -DWORKBENCH $? -o $@

-expand

;# Where shared archive is located (path and name)
;# Where shared archive is located (path and name)
LIBRUN = ../run-time

/* The following are understood by jmake to alter built-in commands */
DPFLAGS = -I$(TOP) -I$(LIBRUN) -I$(LIBRUN)/include -I$(TOP)/idrs
CFLAGS = $(DPFLAGS)

AddSource($(LSRC) $(PSTORE))
CustomLibraryTarget(compiler,$(FOBJ))
CustomLibraryTarget(wcompiler,$(WOBJ))
CustomLibraryTarget(mtcompiler,$(MT_FOBJ))
CustomLibraryTarget(mtwcompiler,$(MT_WOBJ))
SimpleProgramTarget(bytedump)
SimpleProgramTarget(meltdump)
DependTarget()
LintTarget()
