libk  Diff

Differences From Artifact [4eaecd6098]:

To Artifact [9bf8bf8013]:


   212    212   awk -f global/gen-ident.awk <global/modules >$gen/internal.ident.c
   213    213   comp_co $gen/internal.ident.c $to/internal.ident.o
   214    214   
   215    215   # first pass: copy all headers into place,
   216    216   # including ones we need to generate
   217    217   
   218    218   for mod in ${modules[@]}; do
   219         -	for h in $(scan $mod '*.h'); do
          219  +	for h in $(scan mod/$mod '*.h'); do
   220    220   		base=$(basename $h)
   221    221   		cp "$h" "$to/k/$base"
   222    222   	done
   223    223   
   224         -	for h in $(scan $mod '*.h.m'); do
          224  +	for h in $(scan mod/$mod '*.h.m'); do
   225    225   		base=$(basename $h)
   226    226   		dest=${base%%.m}
   227    227   		comp_mac "$h" "$to/k/$dest"
   228    228   	done
   229    229   done
   230    230   
   231    231   # second pass: generate manpage, html, and pdf
   232    232   # versions of the documentation from the md src
   233    233   
   234    234   if test "$doc" = "yes"; then
   235    235   	global/build-manpage.sh libk.md
   236    236   	for mod in ${modules[@]}; do
   237         -		for doc in $(scan $mod '*.md'); do
          237  +		for doc in $(scan mod/$mod '*.md'); do
   238    238   			base="$(basename $doc)"
   239    239   			stem="${base%%.md}"
   240    240   			report global/build-manpage.sh "$doc"
   241    241   		done
   242    242   	done
   243    243   fi
   244    244   
................................................................................
   247    247   # which is a runtime or function unit. exe's
   248    248   # will not be compiled until a later pass
   249    249   
   250    250   fn_objects=()
   251    251   rt_objects=()
   252    252   data_objects=( $to/internal.ident.o )
   253    253   for mod in ${modules[@]}; do
   254         -	for fn in $(scan $mod '*.fn.c'); do
          254  +	for fn in $(scan mod/$mod '*.fn.c'); do
   255    255   		base="$(basename $fn)"
   256    256   		dest="$to/$mod.${base%%.c}.o"
   257    257   		comp_co "$fn" "$dest"
   258    258   		fn_objects+=("$dest")
   259    259   	done
   260    260   
   261         -	for rt in $(scan $mod '*.rt.c'); do
          261  +	for rt in $(scan mod/$mod '*.rt.c'); do
   262    262   		base="$(basename $rt)"
   263    263   		dest="$to/$mod.${base%%.c}.o"
   264    264   		comp_co "$rt" "$dest"
   265    265   		rt_objects+=("$dest")
   266    266   	done
   267    267   
   268         -	for fn in $(scan $mod "*.fn.$target.s"); do
          268  +	for fn in $(scan mod/$mod "*.fn.$target.s"); do
   269    269   		base="$(basename $fn)"
   270    270   		dest="$to/$mod.${base%%.s}.o"
   271    271   		comp_asm "$fn" "$dest"
   272    272   		fn_objects+=("$dest")
   273    273   	done
   274    274   
   275         -	for rt in $(scan $mod "*.rt.$target.s"); do
          275  +	for rt in $(scan mod/$mod "*.rt.$target.s"); do
   276    276   		base="$(basename $rt)"
   277    277   		dest="$to/$mod.${base%%.s}.o"
   278    278   		comp_asm "$rt" "$dest"
   279    279   		rt_objects+=("$dest")
   280    280   	done
   281    281   done
   282    282   
................................................................................
   295    295   	report ld -shared ${fn_objects[@]} -o $to/libk.so
   296    296   fi
   297    297   
   298    298   # fifth pass: compile the executable tools
   299    299   # against the libraries created in pass 5
   300    300   
   301    301   for mod in ${modules[@]}; do
   302         -	for exe in $(scan $mod '*.exe.c'); do
          302  +	for exe in $(scan mod/$mod '*.exe.c'); do
   303    303   		base="$(basename $exe)"
   304    304   		dest="$to/$mod.${base%%.exe.c}"
   305    305   		if test $build_shared_library == yes; then
   306    306   			comp_c "$to/boot.o $exe" "$dest" -lk
   307    307   		else
   308    308   			comp_c "$exe" "$dest" -lk
   309    309   		fi
   310    310   	done
   311    311   done
   312    312   
   313    313   set +x
   314    314   say "all passes finished; build $build complete at $(timestamp)"