123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- #!/bin/bash
- #### INSTAL PARAMS ####
- ARCH=amd64
- ### DIRS ###
- BASEDIR=${_BUILD_DIR}
- INC_DIR=${BASEDIR}/sys/include
- INC_ARCH=${BASEDIR}/${ARCH}/include
- LIB_DIR=${BASEDIR}/${ARCH}/lib
- SRC_DIR=${BASEDIR}/sys/src
- UTIL_DIR=${_BUILD_DIR}/util
- CMD_DIR=${SRC_DIR}/cmd
- KRL_DIR=${SRC_DIR}/9/k10
- TEST_DIR=${SRC_DIR}/test
- ### TOOLCHAIN ###
- AR=ar
- RANLIB=ranlib
- LD=ld
- LEX=lex
- PARSER_GEN=yacc
- COLLECT=/usr/lib/gcc/x86_64-linux-gnu/4.9/collect2
- COLLECTFLAGS="-plugin /usr/lib/gcc/x86_64-linux-gnu/4.9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper --sysroot=/ --build-id -m elf_x86_64 --hash-style=gnu"
- AWK=awk
- XD=xxd
- NM=nm
- ### KERNEL ###
- DATE=$(date +%s)
- EXTKERNDATE="-DKERNDATE=${DATE}"
- KERNEL_CONF="k8cpu"
- ### CMD Provisional!!! ###
- #BUILD_CMD="rc bind mount cat cp echo ls ipconfig ps mkdir pwd chmod rio date dd vga ping telnet dhcpclient srv testalarm"
- # Now essentials are included in build.go
- BUILD_CMD=""
- ### functions ###
- test_hello()
- {
- BUILD_IN="hello.c"
- BUILD_OUT="hello"
- CLEAN_COM="rm -f *.elf.* *.o"
- LIBS_TO_LINK="stdio c"
- LDFLAGS_EXTRA="-static -e_main"
- }
- test_to_fork()
- {
- BUILD_IN="to_fork.c"
- BUILD_OUT="to_fork"
- CLEAN_COM="rm -f *.elf.* *.o"
- LIBS_TO_LINK="stdio c"
- LDFLAGS_EXTRA="-static -e_main"
- }
- test_saymyname()
- {
- BUILD_IN="say.c"
- BUILD_OUT="say"
- CLEAN_COM="rm -f *.elf.* *.o"
- LIBS_TO_LINK="stdio c"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_dd()
- {
- BUILD_IN="dd.c"
- BUILD_OUT="dd.elf.out"
- CLEAN_COM="rm -f *.elf.* *.o"
- LIBS_TO_LINK="libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_chmod()
- {
- BUILD_IN="chmod.c"
- BUILD_OUT="chmod.elf.out"
- CLEAN_COM="rm -f *.elf.* *.o"
- LIBS_TO_LINK="libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_pwd()
- {
- BUILD_IN="pwd.c"
- BUILD_OUT="pwd.elf.out"
- CLEAN_COM="rm -f *.elf.* *.o"
- LIBS_TO_LINK="libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_mkdir()
- {
- BUILD_IN="mkdir.c"
- BUILD_OUT="mkdir.elf.out"
- CLEAN_COM="rm -f *.elf.* *.o"
- LIBS_TO_LINK="libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_rio()
- {
- BUILD_IN="data.c fsys.c rio.c scrl.c time.c util.c wctl.c wind.c xfid.c"
- BUILD_OUT="rio.elf.out"
- CLEAN_COM="rm -f *.elf.* *.o"
- LIBS_TO_LINK="libcomplete libframe libdraw libthread libplumb libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_vga()
- {
- BUILD_DIR=${CMD_DIR}/aux/vga
- BUILD_IN="3dfx.c bt485.c ct65540.c error.c i81x.c ics534x.c mach64xx.c neomagic.c radeon.c s3928.c sc15025.c trio64.c tvp3026.c vga.c vision968.c \
- ark2000pv.c ch9294.c cyber938x.c et4000.c ibm8514.c io.c main.c nvidia.c rgb524.c s3clock.c stg1702.c tvp3020.c tvp3026clock.c virge.c vmware.c \
- att20c49x.c clgd542x.c data.c et4000hwgc.c icd2061a.c mach32.c mga2164w.c palette.c rgb524mn.c s3generic.c t2r4.c tvp3025.c vesa.c vision864.c w30c516.c \
- att21c498.c clgd546x.c db.c hiqvideo.c ics2494.c mach64.c mga4xx.c pci.c s3801.c s3hwgc.c template.c tvp3025clock.c vesadb.c vision964.c"
- BUILD_OUT="vga.elf.out"
- CLEAN_COM="rm -f *.elf.* *.o"
- LIBS_TO_LINK="ndb bio libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_telnet()
- {
- BUILD_DIR=${CMD_DIR}/ip
- BUILD_IN="telnet.c"
- BUILD_OUT="telnet.elf.out"
- CLEAN_COM="rm -f *.elf.* *.o"
- LIBS_TO_LINK="bio ip libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_ping()
- {
- BUILD_DIR=${CMD_DIR}/ip
- BUILD_IN="ping.c"
- BUILD_OUT="ping.elf.out"
- CLEAN_COM="rm -f *.elf.* *.o"
- LIBS_TO_LINK="ndb bio ip libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_ps()
- {
- BUILD_IN="ps.c"
- BUILD_OUT="ps.elf.out"
- CLEAN_COM="rm -f *.elf.* *.o"
- LIBS_TO_LINK="bio libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_cp()
- {
- BUILD_IN="cp.c"
- BUILD_OUT="cp.elf.out"
- CLEAN_COM="rm -f *.elf.* *.o"
- LIBS_TO_LINK="libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_testalarm()
- {
- BUILD_IN="testalarm.c"
- BUILD_OUT="testalarm.elf.out"
- CLEAN_COM="rm -f *.elf.* *.o"
- LIBS_TO_LINK="libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_cat()
- {
- BUILD_IN="cat.c"
- BUILD_OUT="cat.elf.out"
- CLEAN_COM="rm -f *.elf.* *.o"
- LIBS_TO_LINK="libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
|