# crtbegin/crtend for VxWorks

vx_crtbegin.o: $(srcdir)/config/vxcrtstuff.c
	$(crt_compile) $(CRTSTUFF_T_CFLAGS) -DCRT_BEGIN -c $<

vx_crtend.o: $(srcdir)/config/vxcrtstuff.c
	$(crt_compile) $(CRTSTUFF_T_CFLAGS) -DCRT_END -c $<

# We do pretty different things for kernel vs rtp modes, all
# controlled thanks to __RTP__ and (optional) multilibs.

EXTRA_PARTS += vx_crtbegin.o vx_crtend.o

# Shared versions of vx_crt{begin,end}.o, those one must be compiled only
# when the shared libraries are available (ie: for the mrtp multilib)
ifneq (,$(findstring mrtp,$(MULTIDIR)))
vx_crtbeginS.o: $(srcdir)/config/vxcrtstuff.c
	$(crt_compile) $(CRTSTUFF_T_CFLAGS_S) -DCRT_BEGIN -c $< -DCRTSTUFFS_O
vx_crtendS.o: $(srcdir)/config/vxcrtstuff.c
	$(crt_compile) $(CRTSTUFF_T_CFLAGS_S) -DCRT_END -c $< -DCRTSTUFFS_O

EXTRA_PARTS += vx_crtbeginS.o vx_crtendS.o
endif
