# File: drivers/oshkosh/Makefile
#
# Makefile for the OshKosh L4Linux stub device.
#

SUB_DIRS     := 
MOD_SUB_DIRS := $(SUB_DIRS)
ALL_SUB_DIRS := $(SUB_DIRS)

L_TARGET := oshkosh_stub.a
L_OBJS   := 
M_OBJS   :=
MOD_LIST_NAME := OSHK_STUB_MODULES

ifeq ($(CONFIG_OSHK_STUB),y)
L_OBJS += oshkosh_stub.o
else
  ifeq ($(CONFIG_OSHK_STUB),m)
  M_OBJS += oshkosh_stub.o
  endif
endif

DEFINES	= -DSYSTEM_x86_586_l4v2 -DARCH_x86 -DCPUTYPE_586 -DL4API_l4v2

include $(TOPDIR)/Rules.make

oshk_stub_incs	= $(shell $(CC) --print-search-dirs | awk '/^install:/{print $$2"include/"}') \
		$(L4_DIR)/include/x86/l4v2/ $(L4_DIR)/include/x86 \
		$(L4_DIR)/include .

stub.o l4emulstuff.o:%.o:%.c Makefile *.h
	$(CC) -nostdinc $(addprefix -I,$(oshk_stub_incs)) $(DEFINES)\
		$(CPPFLAGS) $(CFLAGS) -c $< -o $@

# if omega0 or con support is compiled in, libnames is linked to kernel.o
ifndef CONFIG_L4_NAME
NAMESLIB=-lnames
endif

oshkosh_stub.o: stub.o l4emulstuff.o setjmp.o
	$(LD) -r -o $@ stub.o l4emulstuff.o setjmp.o \
		-L$(L4_DIR)/lib/x86_586/l4v2 -L$(L4_DIR)/lib/x86_586 \
		-L$(L4_DIR)/lib \
		-loshkoshnicdrv -loshkoshtrace -ldsi-1ipc -ldm_generic -ldm_mem \
		-lsemaphore -lthread_linux_kernel \
		-ll4env $(NAMESLIB) -llogserver_capsule \
		`gcc -print-libgcc-file-name`

clean:
	rm -f core *.o *.a *.s

# Local variables:
#  compile-command: "cd ../../..; TERM='emacs'; m"
# End:
