
# Rule for building objects from NASM assembly files
obj/%.o: %.asm
	nasm -o $@ -f elf $<

# Rule for building the X11 library
lib/libSDLx11.so.$(version): $(PORTABLE_OBJS) $(X11_OBJS) $(ASM_OBJS)
	$(CC) -shared -Wl,-soname,libSDLx11.so.$(version) -o $@ $^ \
				-L/usr/X11R6/lib -lX11 -lXext $(EXTRA_LIBS)
	: Create the symbolic link for the dynamic library
	lib=`basename $@`; \
	link=`echo $$lib | sed 's/\.[0-9]*$$//'`; \
	if [ ! -r lib/$$link ]; then \
	  echo "lib/$$lib <- lib/$$link"; \
	  ln -s $$lib lib/$$link; \
	fi

