![]() | :: | Software | :: | build |
These instructions assume that you have installed current versions of djblib and weblib.
build-project hello cd hello
Create the file src/hello.c containing:
#include "buffer.h"
#include "exit.h"
int main() {
buffer_putsflush(buffer_1,"Hello, world!\n");
_exit(0);
}
Create the file src/hello=x listing the dependencies for the hello command:
unix.a
Create the file src/unix=l listing the dependencies for the unix.a library:
buffer_1.o buffer_put.o buffer_write.o error.o byte_copy.o
Finally, create a top-level default target, by listing in src/it=d the commands to build for the project:
hello
Now build the project:
build
This build fails, due to unresolved subroutine references. Provide the missing information:
echo str_len.o >> src/unix=land build the project again. This time it should succeed. List the contents of the src directory to see what files build borrowed.
cp src/it=d package/commandsNow you can compile targets with
package/compileThis also copies top-level targets to the command/ directory.
PATH=`pwd`:/command:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin export PATH umask 022 rm -rf rts-tmp mkdir rts-tmp cd rts-tmp here=`pwd` echo '--- hello works' hello; echo $?
Run the tests:
package/rtsThe results appear in compile/rts.
package/install
build-dist hello 0.01 >hello-0.01.tar.gzThe tarball is configured for compilation with make.