SRCS = math1_blklib.c math1_chrlib.c math1_fnclib.c math1_gnmlib.c \
    math1_ifalib.c math1_indxlib.c math1_intlib.c math1_lrllib.c \
    math1_oslib.c math1_rfalib.c math1_rfblib.c math1_sublib.c \
    math1_syslib.c math1_vialib.c math1_viblib.c math1_vralib.c \
    math1_vrblib.c math1_xfclib.c math2_fftlib.c math2_intrlib.c \
    math2_rnmlib.c math2_shtlib.c math2_vstlib.c \
    misc1_chnlib.c misc1_datelib.c misc1_fmtlib.c misc1_misclib.c \
    misc1_randlib.c misc1_timelib.c grph1_csgi.c grph1_scpack.c \
    grph1_sgpack.c grph1_slpack.c grph1_stpack.c grph1_swpack.c \
    grph2_grpack.c grph2_ucpack.c grph2_udpack.c grph2_uepack.c \
    grph2_ugpack.c grph2_uhpack.c grph2_ulpack.c grph2_umpack.c \
    grph2_uspack.c grph2_uupack.c grph2_uvpack.c grph2_uwpack.c \
    grph2_uxpack.c grph2_uypack.c grph2_uzpack.c
#    math2_odelib.c \

.SUFFIXES: .fp
.fp.c:
	cd ../ ; \
	cat etc/p_header              > src/$@ ; \
	ruby proto2c.rb proto/$< >> src/$@ ; \
	ruby cproto2init.rb src/$@   >> src/$@ ; \
	cd proto

all: $(SRCS)

clean:
	cd ../src/ ; \
	$(RM) $(SRCS) ;\
	cd ..

distclean: clean
