# Variables INDISPENSABLES!
SYSTEM=sun
CFLAGS-LOCAL=-O $(CFLAGS) -I`pwd`/../../common
CMDDIR=/usr/local/bin
COMPILER=$(CMDDIR)/complice
OBJDIR=../../$(SYSTEM)/o

all: $(OBJDIR)/llx.o $(OBJDIR)/llxmenu.o x.lo

x.lo: x.lm x.ll xicons.ll xmenu.ll
	$(COMPILER) \
		-e '(print "cloading...  " (gc t))' \
		-e '(cload "$(OBJDIR)/llx.o $(OBJDIR)/llxmenu.o -u ←bidon -lXMenu -lX")' \
		-e '(print "cloaded.  " (gc t))' \
		-e '(setq #:system:print-for-read t)' \
		-e '(typecn #/← (quote cmacro))' \
		x

$(OBJDIR)/llx.o: llx.c
	$(CC) $(CFLAGS-LOCAL) -c llx.c
	mv llx.o $(OBJDIR)

$(OBJDIR)/llxmenu.o: llxmenu.c
	$(CC) $(CFLAGS) -c llxmenu.c
	mv llxmenu.o $(OBJDIR)