#
#	Makefile to build clu libraries
#

CLU       = $(CLUHOME)/code/cmp/pclu
LIB_DIR   = ~CLU/lib
LIB_CLU   = ~CLU/lib/clu
SYS_CLU   = ~CLU/sys/clu
LIB_CLU_C = ~CLU/code/libclu
SYS_CLU_C = ~CLU/code/sys

MISC_SOURCES = _int_range bigint dparse heap lex_scan os parse_line \
quicksort quick_sort scase split_line string_lindexs string_ops strim \
xref 

LOWLIB_SOURCES = _resolve _signal_type gcd_tab inet_address
LOWSYS_SOURCES = _cleanup_ _fixup_dir_part _fixup_file_name _skip_fill \
_termcap _working_dir

LOW_EQU = gcd

LOW_SPECS = gcd_tab _adv _byteptr _byteptr8 _bytevec _chan _event _gc _job \
_obj _tagcell _vec _wordvec etc

NOT_LOW = _change_mode _change_owner _dir_ent_size _environs _exit \
_file_access _file_exists _file_facts _file_owner _get_pname \
_get_runtime _get_version _get_xjname _host_name _local_time _real_time \
_sleep _stop _system_root create_directory connected_dir \
delete_directory exp file_date file_exists gc get_argv get_jcl host_address \
istream2chan link_file log now quit_ set_connected_dir sin sleep sqrt \
symlink_file user_name

USELIB_SOURCES = _all_file_names_ _longsub _qindexc \
_time_format _unquote all_file_names array_replace cos \
delete_expunge gc_copy gc_dump gc_read hex \
isqrt octal open_append open_read open_write run_time tan time unify_spacing

USESYS_SOURCES = file_name_fill

USE_SPECS = _signal etc maybe mint table

NOT_USE = _anyize _change_owner _change_signal _cvt _dtable_size \
_environ _environs _erstr _ernum _free_space gcb gco gcr _get_gid _get_pid \
_get_priority _get_termcap _get_uid _groups _heap_size _home_dir _host_id \
_ioctl _last_indexc _local_time _lstat _page_size _pause _read_link \
_round_real _rusage _select _set_alarm _set_limit _set_priority \
_split_name_part _stat _termcap_entry _umask _unparse_real istream2chan \
now stream2chan user_name



MISC_SPECS = random.spc

libs: fictitious_file
	make misc.lib
	make lowlev.lib
	make useful.lib

c_files: fictitious_file
	make libs ; \
	$(CLU)  \#ext false \#me lowlev, misc, useful \
		\#spec _gprof.spc \#dir $(SYS_CLU) \
		\#bindir $(SYS_CLU_C) \#co \*
	$(CLU)  \#ext false \#me lowlev, misc, useful \#ce gcd.equ \
		\#spec _host_address _all_dir_entries_ \
		\#dir $(LIB_CLU) \
		\#spec gcd_tab, gc_read \
		\#bindir $(LIB_CLU_C) \#co \*

misc.lib: fictitious_file 
	$(CLU) \#ext false \#newlib \
	    \#dir ${LIB_CLU} \#spec ${MISC_SOURCES} \#dir ${LIB_DIR} \
			     \#spec ${MISC_SPECS} \#dump misc 

lowlev.lib: fictitious_file
	$(CLU) \#ext false \#newlib \
            \#dir ${LIB_DIR} \#spec ${LOW_SPECS} \#ce ${LOW_EQU} \
	    \#dir ${LIB_CLU} \#spec ${LOWLIB_SOURCES} \
            \#dir ${LIB_DIR} \#spec ${LOW_SPECS} \
	    \#dir ${LIB_CLU} \#spec ${LOWLIB_SOURCES} \
	    \#dir ${SYS_CLU} \#spec ${LOWSYS_SOURCES} \
            \#dir ${LIB_DIR} \#forget ${NOT_LOW} \
	    \#dump lowlev 
			     
useful.lib: fictitious_file
	$(CLU) \#ext false \#newlib \
            \#dir ${LIB_DIR} \#me lowlev.lib \#ce ${LOW_EQU} \
            \#dir ${LIB_DIR} \#spec ${USE_SPECS} \
	    \#dir ${LIB_CLU} \#spec ${USELIB_SOURCES} \
	    \#dir ${SYS_CLU} \#spec ${USESYS_SOURCES} \
	    \#dir ${LIB_DIR} \
	    \#forget ${NOT_USE} \#unmerge lowlev.lib \
	    \#dump useful 
			     
fictitious_file:

