123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473 |
- #!/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
- ### COMPILER ###
- CC=gcc
- CFLAGS_DEBUG="-g"
- CFLAGS_LIB="-O0 -static -fplan9-extensions -ffreestanding -fno-builtin -Wall -Wno-missing-braces -Wno-parentheses -Wno-unknown-pragmas -Wuninitialized -Wmaybe-uninitialized -I${INC_ARCH} -I${INC_DIR}"
- CFLAGS_KLIB="-mcmodel=kernel -O0 -fplan9-extensions -ffreestanding -fno-builtin -Wall -Wno-missing-braces -Wno-parentheses -Wno-unknown-pragmas -Wuninitialized -Wmaybe-uninitialized -I${INC_ARCH} -I${INC_DIR}"
- CFLAGS_CMD="-mcmodel=small -O0 -fplan9-extensions -ffreestanding -fno-builtin -Wall -Wno-missing-braces -Wno-parentheses -Wno-unknown-pragmas -Wuninitialized -Wmaybe-uninitialized -I${INC_ARCH} -I${INC_DIR}"
- LDFLAGS=-L$LIB_DIR
- 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"
- KERNEL_SOURCE="entry.S *.c ../386/*.c ../ip/*.c ../port/*.c l64v.S l64fpu.S cpuidamd64.S l64acidt.S l64idt.S l64vsyscall.S "
- KERNEL_CFLAGS="-mcmodel=kernel -O0 -static -fplan9-extensions -ffreestanding -fno-builtin ${EXTKERNDATE}"
- KERNEL_CFLAGS_DEBUG="-g -fvar-tracking -fvar-tracking-assignments"
- KERNEL_WARNFLAGS="-Wall -Wno-missing-braces -Wno-parentheses -Wno-unknown-pragmas -Wuninitialized -Wmaybe-uninitialized"
- KERNEL_UCFLAGS="-O0 -static -fplan9-extensions -ffreestanding -fno-builtin"
- KERNEL_GLOBIGNORE=*devcap.c:*sdaoe.c:ratrace.c:*doauthenticate.c:*getpasswd.c:*nopsession.c:*archk8.c:*rdb.c:*etherbcm.c:*devprobe.c:*tcklock.c:*sd.c:*ssl.c:*tls.c:*proc-OLD.c:*proc-SMP.c
- KERNEL_LDFLAGS="-z max-page-size=0x1000 -nostdlib -g"
- KERNEL_OBJECT=9k
- ### Libraries ###
- BUILD_LIBS="lib9p libString libauth libauthsrv libavl libbin libbio libcomplete libcontrol libdisk libdraw libflate libframe libgeometry libhtml libhttpd\
- liblex libmemdraw libmemlayer libndb libplumb libregexp libstdio libsunrpc libthread libventi libc libmp libip"
- BUILD_KLIBS="libc libip libdraw"
- ### CMD ###
- BUILD_CMD="rc bind mount cat cp echo ls ipconfig ps mkdir pwd chmod rio date dd vga ping telnet dhcpclient srv"
- ### functions ###
- test_hello()
- {
- BUILD_IN="hello.c"
- BUILD_OUT="hello"
- CLEAN_COM="rm -f *.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 *.o"
- LIBS_TO_LINK="stdio c"
- LDFLAGS_EXTRA="-static -e_main"
- }
- test_saymyname()
- {
- BUILD_IN="say.c"
- BUILD_OUT="say"
- CLEAN_COM="rm -f *.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 *.o"
- LIBS_TO_LINK="libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_date()
- {
- BUILD_IN="date.c"
- BUILD_OUT="date.elf.out"
- CLEAN_COM="rm -f *.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 *.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 *.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 *.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 *.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 *.o"
- LIBS_TO_LINK="ndb bio libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_srv()
- {
- BUILD_IN="srv.c"
- BUILD_OUT="srv.elf.out"
- CLEAN_COM="rm -f *.o"
- LIBS_TO_LINK="libauth bio ip libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_dhcpclient()
- {
- BUILD_DIR=${CMD_DIR}/ip
- BUILD_IN="dhcpclient.c"
- BUILD_OUT="dhcpclient.elf.out"
- CLEAN_COM="rm -f *.o"
- LIBS_TO_LINK="bio ip 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 *.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 *.o"
- LIBS_TO_LINK="ndb bio ip libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_ipconfig()
- {
- BUILD_DIR=${CMD_DIR}/ip/ipconfig
- BUILD_IN="ipv6.c main.c ppp.c"
- BUILD_OUT="ipconfig.elf.out"
- CLEAN_COM="rm -f *.o"
- LIBS_TO_LINK="9p ndb bio ip libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_ps()
- {
- BUILD_IN="ps.c"
- BUILD_OUT="ps.elf.out"
- CLEAN_COM="rm -f *.o"
- LIBS_TO_LINK="bio libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_ls()
- {
- BUILD_IN="ls.c"
- BUILD_OUT="ls.elf.out"
- CLEAN_COM="rm -f *.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 *.o"
- LIBS_TO_LINK="libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_echo()
- {
- BUILD_IN="echo.c"
- BUILD_OUT="echo.elf.out"
- CLEAN_COM="rm -f *.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 *.o"
- LIBS_TO_LINK="libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_rc()
- {
- BUILD_IN=" code.c \
- exec.c \
- getflags.c \
- glob.c \
- havefork.c \
- here.c \
- io.c \
- lex.c \
- pcmd.c \
- pfnc.c \
- plan9.c \
- simple.c \
- subr.c \
- trap.c \
- tree.c \
- var.c \
- y.tab.c \
- "
- BUILD_OUT="rc.elf.out"
- CLEAN_COM="rm -f *.o *.tab.*"
- LIBS_TO_LINK="String libc"
- LDFLAGS_EXTRA="-static -e_main"
-
- #Extra tasks if we're compiling
- if [ $1 -eq 1 ]
- then
- echo "$PARSER_GEN -d syn.y"
- $PARSER_GEN -d syn.y
- if [ $? -ne 0 ]
- then
- echo "ERROR executing $PARSER_GEN"
- exit 1
- fi
- echo "cp y.tab.h x.tab.h"
- cp y.tab.h x.tab.h
- if [ $? -ne 0 ]
- then
- echo "ERROR copying y.tab.h to x.tab.h"
- fi
- fi
- }
- # One for command? ugh, do it better!!
- cmd_bind()
- {
- BUILD_IN="bind.c"
- BUILD_OUT="bind.elf.out"
- CLEAN_COM="rm -f *.o"
- LIBS_TO_LINK="libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- cmd_mount()
- {
- BUILD_IN="mount.c"
- BUILD_OUT="mount.elf.out"
- CLEAN_COM="rm -f *.o"
- LIBS_TO_LINK="auth libc"
- LDFLAGS_EXTRA="-static -e_main"
- }
- lib9p()
- {
- BUILD_IN=" auth.c\
- dirread.c\
- fid.c\
- file.c\
- intmap.c\
- listen.c\
- mem.c\
- req.c\
- parse.c\
- post.c\
- rfork.c\
- srv.c\
- thread.c\
- uid.c\
- util.c\
- "
- BUILD_OUT="${LIB_DIR}/lib9p.a"
- CLEAN_COM="rm -f *.o"
- }
- libString()
- {
- BUILD_IN=" s_alloc.c\
- s_append.c\
- s_array.c\
- s_copy.c\
- s_getline.c\
- s_grow.c\
- s_memappend.c\
- s_nappend.c\
- s_parse.c\
- s_putc.c\
- s_rdinstack.c\
- s_read.c\
- s_read_line.c\
- s_reset.c\
- s_terminate.c\
- s_tolower.c\
- s_unique.c\
- "
- BUILD_OUT="${LIB_DIR}/libString.a"
- CLEAN_COM="rm -f *.o"
- }
- libauth()
- {
- BUILD_IN=" amount.c\
- amount_getkey.c\
- attr.c\
- auth_attr.c\
- auth_challenge.c\
- auth_chuid.c\
- auth_getkey.c\
- auth_getuserpasswd.c\
- auth_proxy.c\
- auth_respond.c\
- auth_rpc.c\
- auth_userpasswd.c\
- auth_wep.c\
- login.c\
- newns.c\
- noworld.c\
- "
- BUILD_OUT="${LIB_DIR}/libauth.a"
- CLEAN_COM="rm -f *.o"
- }
- libauthsrv()
- {
- BUILD_IN=" _asgetticket.c\
- _asrdresp.c\
- authdial.c\
- convA2M.c\
- convM2A.c\
- convM2PR.c\
- convM2T.c\
- convM2TR.c\
- convPR2M.c\
- convT2M.c\
- convTR2M.c\
- nvcsum.c\
- opasstokey.c\
- passtokey.c\
- readnvram.c\
- "
- BUILD_OUT="${LIB_DIR}/libauthsrv.a"
- CLEAN_COM="rm -f *.o"
- }
- libavl()
- {
- BUILD_IN="avl.c"
- BUILD_OUT="${LIB_DIR}/libavl.a"
- CLEAN_COM="rm -f *.o"
- }
- libbin()
- {
- BUILD_IN="bin.c"
- BUILD_OUT="${LIB_DIR}/libbin.a"
- CLEAN_COM="rm -f *.o"
- }
- libbio()
- {
- BUILD_IN=" bbuffered.c\
- bfildes.c\
- bflush.c\
- bgetrune.c\
- bgetc.c\
- bgetd.c\
- binit.c\
- boffset.c\
- bprint.c\
- bputrune.c\
- bputc.c\
- brdline.c\
- brdstr.c\
- bread.c\
- bseek.c\
- bwrite.c\
- bvprint.c\
- "
- BUILD_OUT="${LIB_DIR}/libbio.a"
- CLEAN_COM="rm -f *.o"
- }
- libcomplete()
- {
- BUILD_IN="complete.c"
- BUILD_OUT="${LIB_DIR}/libcomplete.a"
- CLEAN_COM="rm -f *.o"
- }
- libcontrol()
- {
- BUILD_IN=" box.c\
- button.c\
- cache.c\
- control.c\
- entry.c\
- group.c\
- keyboard.c\
- label.c\
- menu.c\
- radiobutton.c\
- scribble.c\
- slider.c\
- tabs.c\
- text.c\
- textbutton.c\
- textbutton3.c\
- "
- BUILD_OUT="${LIB_DIR}/libcontrol.a"
- CLEAN_COM="rm -f *.o"
- }
- libdisk()
- {
- BUILD_IN=" disk.c\
- proto.c\
- scsi.c\
- "
- BUILD_OUT="${LIB_DIR}/libdisk.a"
- CLEAN_COM="rm -f *.o"
- }
- libdraw()
- {
- BUILD_IN=" alloc.c\
- allocimagemix.c\
- arith.c\
- bezier.c\
- border.c\
- buildfont.c\
- bytesperline.c\
- chan.c\
- cloadimage.c\
- computil.c\
- creadimage.c\
- debug.c\
- defont.c\
- draw.c\
- drawrepl.c\
- egetrect.c\
- ellipse.c\
- emenuhit.c\
- event.c\
- fmt.c\
- font.c\
- freesubfont.c\
- getdefont.c\
- getrect.c\
- getsubfont.c\
- icossin.c\
- icossin2.c\
- init.c\
- keyboard.c\
- line.c\
- menuhit.c\
- mkfont.c\
- mouse.c\
- newwindow.c\
- openfont.c\
- poly.c\
- loadimage.c\
- readcolmap.c\
- readimage.c\
- readsubfont.c\
- rectclip.c\
- replclipr.c\
- rgb.c\
- scroll.c\
- string.c\
- stringbg.c\
- stringsubfont.c\
- stringwidth.c\
- subfont.c\
- subfontcache.c\
- subfontname.c\
- unloadimage.c\
- window.c\
- writecolmap.c\
- writeimage.c\
- writesubfont.c\
- "
- BUILD_OUT="${LIB_DIR}/libdraw.a"
- CLEAN_COM="rm -f *.o"
- }
- libflate()
- {
-
- BUILD_IN=" deflate.c\
- deflatezlib.c\
- deflateblock.c\
- deflatezlibblock.c\
- inflate.c\
- inflatezlib.c\
- inflateblock.c\
- inflatezlibblock.c\
- flateerr.c\
- crc.c\
- adler.c\
- "
- BUILD_OUT=${LIB_DIR}/libflate.a
- CLEAN_COM="rm -f *.o"
- }
- libframe()
- {
- BUILD_IN=" frbox.c\
- frdraw.c\
- frdelete.c\
- frinit.c\
- frinsert.c\
- frptofchar.c\
- frselect.c\
- frstr.c\
- frutil.c\
- "
- BUILD_OUT=${LIB_DIR}/libframe.a
- CLEAN_COM="rm -f *.o"
- }
- libgeometry()
- {
- BUILD_IN=" arith3.c\
- matrix.c\
- qball.c\
- quaternion.c\
- transform.c\
- tstack.c\
- "
- BUILD_OUT=${LIB_DIR}/libgeometry.a
- CLEAN_COM="rm -f *.o"
- }
- libhtml()
- {
- BUILD_IN=" build.c\
- lex.c\
- strinttab.c\
- utils.c\
- "
- BUILD_OUT=${LIB_DIR}/libhtml.a
- CLEAN_COM="rm -f *.o"
- }
- libhttpd()
- {
- BUILD_IN=" alloc.c\
- checkcontent.c\
- date.c\
- fail.c\
- gethead.c\
- hio.c\
- httpfmt.c\
- httpunesc.c\
- lower.c\
- okheaders.c\
- parse.c\
- parsereq.c\
- query.c\
- redirected.c\
- unallowed.c\
- urlfmt.c\
- urlunesc.c\
- "
- BUILD_OUT=${LIB_DIR}/libhttpd.a
- CLEAN_COM="rm -f *.o"
- }
- liblex()
- {
- BUILD_IN=" allprint.c\
- main.c\
- reject.c\
- yyless.c\
- yywrap.c\
- "
- BUILD_OUT=${LIB_DIR}/libl.a
- CLEAN_COM="rm -f *.o"
-
- CFLAGS_EXTRA=-I${SRC_DIR}/cmd/lex
- }
- libmemdraw()
- {
- BUILD_IN=" alloc.c\
- arc.c\
- cload.c\
- cmap.c\
- cread.c\
- defont.c\
- draw.c\
- ellipse.c\
- fillpoly.c\
- hwdraw.c\
- iprint.c\
- line.c\
- load.c\
- openmemsubfont.c\
- poly.c\
- read.c\
- string.c\
- subfont.c\
- unload.c\
- write.c\
- "
- BUILD_OUT=${LIB_DIR}/libmemdraw.a
- CLEAN_COM="rm -f *.o"
- }
- libmemlayer()
- {
- BUILD_IN=" draw.c\
- lalloc.c\
- layerop.c\
- ldelete.c\
- lhide.c\
- line.c\
- load.c\
- lorigin.c\
- lsetrefresh.c\
- ltofront.c\
- ltorear.c\
- unload.c\
- "
- BUILD_OUT=${LIB_DIR}/libmemlayer.a
- CLEAN_COM="rm -f *.o"
- }
- libndb()
- {
- BUILD_IN=" csgetval.c\
- csipinfo.c\
- dnsquery.c\
- ipattr.c\
- ndbaux.c\
- ndbcache.c\
- ndbcat.c\
- ndbconcatenate.c\
- ndbdiscard.c\
- ndbfree.c\
- ndbgetipaddr.c\
- ndbgetval.c\
- ndbhash.c\
- ndbipinfo.c\
- ndblookval.c\
- ndbopen.c\
- ndbparse.c\
- ndbreorder.c\
- ndbsubstitute.c\
- "
- BUILD_OUT=${LIB_DIR}/libndb.a
- CLEAN_COM="rm -f *.o"
-
- CFLAGS_EXTRA=-I${SRC_DIR}/libndb
- }
- libplumb()
- {
- BUILD_IN=" event.c\
- mesg.c\
- plumbsendtext.c\
- "
- BUILD_OUT=${LIB_DIR}/libplumb.a
- CLEAN_COM="rm -f *.o"
- }
- libregexp()
- {
- BUILD_IN=" regcomp.c\
- regerror.c\
- regexec.c\
- regsub.c\
- regaux.c\
- rregexec.c\
- rregsub.c\
- "
- BUILD_OUT=${LIB_DIR}/libregexp.a
- CLEAN_COM="rm -f *.o"
- }
- libstdio()
- {
- BUILD_IN=" _IO_getc.c\
- _IO_putc.c\
- clearerr.c\
- dtoa.c\
- fclose.c\
- fdopen.c\
- feof.c\
- ferror.c\
- fflush.c\
- fgetc.c\
- fgetpos.c\
- fgets.c\
- fileno.c\
- fopen.c\
- fprintf.c\
- fputc.c\
- fputs.c\
- fread.c\
- freopen.c\
- fscanf.c\
- fseek.c\
- fseeko.c\
- fsetpos.c\
- ftell.c\
- ftello.c\
- fwrite.c\
- getc.c\
- gets.c\
- printf.c\
- putc.c\
- puts.c\
- rewind.c\
- scanf.c\
- sclose.c\
- setbuf.c\
- setvbuf.c\
- snprintf.c\
- sopenr.c\
- sopenw.c\
- sprintf.c\
- sscanf.c\
- tmpfile.c\
- tmpnam.c\
- ungetc.c\
- vfprintf.c\
- vfscanf.c\
- vprintf.c\
- vsnprintf.c\
- vsprintf.c\
- "
- BUILD_OUT=${LIB_DIR}/libstdio.a
- CLEAN_COM="rm -f *.o"
- }
- libsunrpc()
- {
- BUILD_IN=" mount3.c\
- nfs3.c\
- portmap.c\
- authunix.c\
- client.c\
- emalloc.c\
- error.c\
- fd.c\
- fmt.c\
- net.c\
- prog.c\
- rpc.c\
- server.c\
- suncall.c\
- udp.c\
- "
- BUILD_OUT=${LIB_DIR}/libsunrpc.a
- CLEAN_COM="rm -f *.o"
- }
- libthread()
- {
- BUILD_IN=" amd64.c\
- channel.c\
- chanprint.c\
- create.c\
- debug.c\
- dial.c\
- exec.c\
- exit.c\
- id.c\
- iocall.c\
- ioclose.c\
- iodial.c\
- ioopen.c\
- ioproc.c\
- ioread.c\
- ioreadn.c\
- iosleep.c\
- iowrite.c\
- kill.c\
- lib.c\
- main.c\
- note.c\
- ref.c\
- rendez.c\
- sched.c\
- "
- BUILD_OUT=${LIB_DIR}/libthread.a
- CLEAN_COM="rm -f *.o"
- }
- libventi()
- {
- BUILD_IN=" cache.c\
- client.c\
- conn.c\
- dial.c\
- debug.c\
- dtype.c\
- entry.c\
- fcall.c\
- fcallfmt.c\
- file.c\
- hangup.c\
- log.c\
- mem.c\
- packet.c\
- parsescore.c\
- queue.c\
- root.c\
- rpc.c\
- scorefmt.c\
- send.c\
- server.c\
- srvhello.c\
- strdup.c\
- string.c\
- time.c\
- version.c\
- zero.c\
- zeroscore.c\
- "
- BUILD_OUT=${LIB_DIR}/libventi.a
- CLEAN_COM="rm -f *.o"
- }
- libc()
- {
- SUBDIRS="9sys 9syscall fmt port $ARCH"
- }
- libc_9sys()
- {
-
- BUILD_IN=" abort.c\
- access.c\
- announce.c\
- convD2M.c\
- convM2D.c\
- convM2S.c\
- convS2M.c\
- cputime.c\
- ctime.c\
- dial.c\
- dirfstat.c\
- dirfwstat.c\
- dirmodefmt.c\
- dirread.c\
- dirstat.c\
- dirwstat.c\
- fcallfmt.c\
- fork.c\
- getnetconninfo.c\
- getenv.c\
- getpid.c\
- getppid.c\
- getwd.c\
- iounit.c\
- nulldir.c\
- postnote.c\
- privalloc.c\
- pushssl.c\
- pushtls.c\
- putenv.c\
- qlock.c\
- read.c\
- read9pmsg.c\
- readv.c\
- rerrstr.c\
- sbrk.c\
- setnetmtpt.c\
- sysfatal.c\
- syslog.c\
- sysname.c\
- time.c\
- times.c\
- tm2sec.c\
- truerand.c\
- wait.c\
- waitpid.c\
- werrstr.c\
- write.c\
- writev.c\
- "
- BUILD_OUT=${LIB_DIR}/libc.a
- CLEAN_COM="rm -f *.o"
- }
- libc_9syscall()
- {
- if [ $1 -eq 1 ]
- then
- DO_NOTHING=1
- ${UTIL_DIR}/mksys $ARCH
- if [ $? -eq 0 ]
- then
- echo $CC $BUILD_DEBUG -c *.s
- $CC $BUILD_DEBUG -c *.s
- if [ $? -ne 0 ]
- then
- echo "ERROR compiling libc"
- fi
- echo $AR rv "${LIB_DIR}/libc.a" *.o
- $AR rv "${LIB_DIR}/libc.a" *.o
- else
- echo "ERROR executing ${UTIL_DIR}/mksys $ARCH"
- fi
- fi
- CLEAN_COM="rm -f *.o *.s"
- }
- libc_fmt()
- {
- BUILD_IN=" dofmt.c\
- dorfmt.c\
- errfmt.c\
- fltfmt.c\
- fmt.c\
- fmtfd.c\
- fmtlock.c\
- fmtprint.c\
- fmtquote.c\
- fmtrune.c\
- fmtstr.c\
- fmtvprint.c\
- fprint.c\
- print.c\
- runefmtstr.c\
- runeseprint.c\
- runesmprint.c\
- runesnprint.c\
- runesprint.c\
- runevseprint.c\
- runevsmprint.c\
- runevsnprint.c\
- seprint.c\
- smprint.c\
- snprint.c\
- sprint.c\
- vfprint.c\
- vseprint.c\
- vsmprint.c\
- vsnprint.c\
- "
- BUILD_OUT=${LIB_DIR}/libc.a
- CLEAN_COM="rm -f *.o"
- }
- libc_port()
- {
- BUILD_IN=" _assert.c\
- abs.c\
- asin.c\
- atan.c\
- atan2.c\
- atexit.c\
- atnotify.c\
- atof.c\
- atol.c\
- atoll.c\
- cistrcmp.c\
- cistrncmp.c\
- cistrstr.c\
- charstod.c\
- cleanname.c\
- crypt.c\
- ctype.c\
- encodefmt.c\
- execl.c\
- exp.c\
- fabs.c\
- floor.c\
- fmod.c\
- frand.c\
- frexp.c\
- getcallerpc.c\
- getfields.c\
- getuser.c\
- hangup.c\
- hypot.c\
- lnrand.c\
- lock.c\
- log.c\
- lrand.c\
- malloc.c\
- memccpy.c\
- memchr.c\
- memcmp.c\
- memmove.c\
- memset.c\
- mktemp.c\
- muldiv.c\
- nan.c\
- needsrcquote.c\
- netcrypt.c\
- netmkaddr.c\
- nrand.c\
- ntruerand.c\
- perror.c\
- pool.c\
- pow.c\
- pow10.c\
- profile.c\
- qsort.c\
- quote.c\
- rand.c\
- readn.c\
- rune.c\
- runebase.c\
- runebsearch.c\
- runestrcat.c\
- runestrchr.c\
- runestrcmp.c\
- runestrcpy.c\
- runestrecpy.c\
- runestrdup.c\
- runestrncat.c\
- runestrncmp.c\
- runestrncpy.c\
- runestrrchr.c\
- runestrlen.c\
- runestrstr.c\
- runetype.c\
- sin.c\
- sinh.c\
- sqrt.c\
- strcat.c\
- strchr.c\
- strcmp.c\
- strcpy.c\
- strecpy.c\
- strcspn.c\
- strdup.c\
- strlen.c\
- strncat.c\
- strncmp.c\
- strncpy.c\
- strpbrk.c\
- strrchr.c\
- strspn.c\
- strstr.c\
- strtod.c\
- strtok.c\
- strtol.c\
- strtoll.c\
- strtoul.c\
- strtoull.c\
- tan.c\
- tanh.c\
- tokenize.c\
- toupper.c\
- utfecpy.c\
- utflen.c\
- utfnlen.c\
- utfrune.c\
- utfrrune.c\
- utfutf.c\
- u16.c\
- u32.c\
- u64.c\
- "
- BUILD_OUT=${LIB_DIR}/libc.a
- CLEAN_COM="rm -f *.o"
- }
- libc_amd64()
- {
- BUILD_IN=" _seek.c\
- notejmp.c\
- cycles.c\
- argv0.c\
- rdpmc.c\
- "
- BUILD_OUT=${LIB_DIR}/libc.a
- CLEAN_COM="rm -f *.o"
-
- if [ $1 -eq 1 ]
- then
- as -o setjmp.o -c setjmp.s
- as -o sqrt.o -c sqrt.s
- as -o tas.o -c tas.s
- echo "$CC $CFLAGS_LIB $BUILD_DEBUG -o atom.o -c atom.S"
- $CC $CFLAGS_LIB $BUILD_DEBUG -o atom.o -c atom.S
- echo "$CC $CFLAGS_LIB $BUILD_DEBUG -o main9.o -c main9.S"
- $CC $CFLAGS_LIB $BUILD_DEBUG -o main9.o -c main9.S
- fi
- }
- libmp()
- {
- SUBDIRS="port $ARCH"
- }
- libmp_port()
- {
- BUILD_IN=" mpaux.c\
- mpfmt.c\
- strtomp.c\
- mptobe.c\
- mptole.c\
- betomp.c\
- letomp.c\
- mpadd.c\
- mpsub.c\
- mpcmp.c\
- mpfactorial.c\
- mpmul.c\
- mpleft.c\
- mpright.c\
- mpvecadd.c\
- mpvecsub.c\
- mpvecdigmuladd.c\
- mpveccmp.c\
- mpdigdiv.c\
- mpdiv.c\
- mpexp.c\
- mpmod.c\
- mpextendedgcd.c\
- mpinvert.c\
- mprand.c\
- crt.c\
- mptoi.c\
- mptoui.c\
- mptov.c\
- mptouv.c\
- "
- BUILD_OUT=${LIB_DIR}/libmp.a
- CLEAN_COM="rm -f *.o"
- }
- libmp_amd64()
- {
- DO_NOTHING=1
- }
- libip()
- {
- BUILD_IN=" eipfmt.c\
- equivip.c\
- parseip.c\
- parseether.c\
- myetheraddr.c\
- myipaddr.c\
- classmask.c\
- bo.c\
- readipifc.c\
- ipaux.c\
- ptclbsum.c\
- "
- BUILD_OUT=${LIB_DIR}/libip.a
- CLEAN_COM="rm -f *.o"
- }
- klibc()
- {
- BUILD_IN=" ./9sys/abort.c \
- ./9sys/access.c \
- ./9sys/announce.c \
- ./9sys/convD2M.c \
- ./9sys/convM2D.c \
- ./9sys/convM2S.c \
- ./9sys/convS2M.c \
- ./9sys/cputime.c \
- ./9sys/ctime.c \
- ./9sys/dial.c \
- ./9sys/dirfstat.c \
- ./9sys/dirfwstat.c \
- ./9sys/dirmodefmt.c \
- ./9sys/dirread.c \
- ./9sys/dirstat.c \
- ./9sys/dirwstat.c \
- ./9sys/fcallfmt.c \
- ./9sys/fork.c \
- ./9sys/getnetconninfo.c \
- ./9sys/getenv.c \
- ./9sys/getpid.c \
- ./9sys/getppid.c \
- ./9sys/getwd.c \
- ./9sys/iounit.c \
- ./9sys/nulldir.c \
- ./9sys/postnote.c \
- ./9sys/privalloc.c \
- ./9sys/pushssl.c \
- ./9sys/pushtls.c \
- ./9sys/putenv.c \
- ./9sys/qlock.c \
- ./9sys/read.c \
- ./9sys/read9pmsg.c \
- ./9sys/readv.c \
- ./9sys/rerrstr.c \
- ./9sys/sbrk.c \
- ./9sys/setnetmtpt.c \
- ./9sys/sysfatal.c \
- ./9sys/syslog.c \
- ./9sys/sysname.c \
- ./9sys/time.c \
- ./9sys/times.c \
- ./9sys/tm2sec.c \
- ./9sys/truerand.c \
- ./9sys/wait.c \
- ./9sys/waitpid.c \
- ./9sys/werrstr.c \
- ./9sys/write.c \
- ./9sys/writev.c \
- ./fmt/dofmt.c \
- ./fmt/dorfmt.c \
- ./fmt/errfmt.c \
- ./fmt/fltfmt.c \
- ./fmt/fmt.c \
- ./fmt/fmtfd.c \
- ./fmt/fmtlock.c \
- ./fmt/fmtprint.c \
- ./fmt/fmtquote.c \
- ./fmt/fmtrune.c \
- ./fmt/fmtstr.c \
- ./fmt/fmtvprint.c \
- ./fmt/fprint.c \
- ./fmt/print.c \
- ./fmt/runefmtstr.c \
- ./fmt/runeseprint.c \
- ./fmt/runesmprint.c \
- ./fmt/runesnprint.c \
- ./fmt/runesprint.c \
- ./fmt/runevseprint.c \
- ./fmt/runevsmprint.c \
- ./fmt/runevsnprint.c \
- ./fmt/seprint.c \
- ./fmt/smprint.c \
- ./fmt/snprint.c \
- ./fmt/sprint.c \
- ./fmt/vfprint.c \
- ./fmt/vseprint.c \
- ./fmt/vsmprint.c \
- ./fmt/vsnprint.c \
- ./port/_assert.c \
- ./port/abs.c \
- ./port/asin.c \
- ./port/atan.c \
- ./port/atan2.c \
- ./port/atexit.c \
- ./port/atnotify.c \
- ./port/atof.c \
- ./port/atol.c \
- ./port/atoll.c \
- ./port/cistrcmp.c \
- ./port/cistrncmp.c \
- ./port/cistrstr.c \
- ./port/charstod.c \
- ./port/cleanname.c \
- ./port/crypt.c \
- ./port/ctype.c \
- ./port/encodefmt.c \
- ./port/execl.c \
- ./port/exp.c \
- ./port/fabs.c \
- ./port/floor.c \
- ./port/fmod.c \
- ./port/frand.c \
- ./port/frexp.c \
- ./port/getcallerpc.c \
- ./port/getfields.c \
- ./port/getuser.c \
- ./port/hangup.c \
- ./port/hypot.c \
- ./port/lnrand.c \
- ./port/lock.c \
- ./port/log.c \
- ./port/lrand.c \
- ./port/malloc.c \
- ./port/memccpy.c \
- ./port/memchr.c \
- ./port/memcmp.c \
- ./port/memmove.c \
- ./port/memset.c \
- ./port/mktemp.c \
- ./port/muldiv.c \
- ./port/nan.c \
- ./port/needsrcquote.c \
- ./port/netcrypt.c \
- ./port/netmkaddr.c \
- ./port/nrand.c \
- ./port/ntruerand.c \
- ./port/perror.c \
- ./port/pool.c \
- ./port/pow.c \
- ./port/pow10.c \
- ./port/profile.c \
- ./port/qsort.c \
- ./port/quote.c \
- ./port/rand.c \
- ./port/readn.c \
- ./port/rune.c \
- ./port/runebase.c \
- ./port/runebsearch.c \
- ./port/runestrcat.c \
- ./port/runestrchr.c \
- ./port/runestrcmp.c \
- ./port/runestrcpy.c \
- ./port/runestrecpy.c \
- ./port/runestrdup.c \
- ./port/runestrncat.c \
- ./port/runestrncmp.c \
- ./port/runestrncpy.c \
- ./port/runestrrchr.c \
- ./port/runestrlen.c \
- ./port/runestrstr.c \
- ./port/runetype.c \
- ./port/sin.c \
- ./port/sinh.c \
- ./port/sqrt.c \
- ./port/strcat.c \
- ./port/strchr.c \
- ./port/strcmp.c \
- ./port/strcpy.c \
- ./port/strecpy.c \
- ./port/strcspn.c \
- ./port/strdup.c \
- ./port/strlen.c \
- ./port/strncat.c \
- ./port/strncmp.c \
- ./port/strncpy.c \
- ./port/strpbrk.c \
- ./port/strrchr.c \
- ./port/strspn.c \
- ./port/strstr.c \
- ./port/strtod.c \
- ./port/strtok.c \
- ./port/strtol.c \
- ./port/strtoll.c \
- ./port/strtoul.c \
- ./port/strtoull.c \
- ./port/tan.c \
- ./port/tanh.c \
- ./port/tokenize.c \
- ./port/toupper.c \
- ./port/utfecpy.c \
- ./port/utflen.c \
- ./port/utfnlen.c \
- ./port/utfrune.c \
- ./port/utfrrune.c \
- ./port/utfutf.c \
- ./port/u16.c \
- ./port/u32.c \
- ./port/u64.c \
- ./amd64/_seek.c \
- ./amd64/notejmp.c \
- ./amd64/cycles.c \
- ./amd64/argv0.c \
- ./amd64/rdpmc.c
- "
- BUILD_OUT="${LIB_DIR}/klibc.a"
- CLEAN_COM="rm -f *.o"
- }
- klibip()
- {
- BUILD_IN="bo.c classmask.c eipfmt.c equivip.c ipaux.c myetheraddr.c myipaddr.c parseether.c parseip.c ptclbsum.c readipifc.c testreadipifc.c"
- BUILD_OUT=${LIB_DIR}/klibip.a
- CLEAN_COM="rm -f *.o"
- }
- klibdraw()
- {
- BUILD_IN=" alloc.c\
- allocimagemix.c\
- arith.c\
- bezier.c\
- border.c\
- buildfont.c\
- bytesperline.c\
- chan.c\
- cloadimage.c\
- computil.c\
- creadimage.c\
- debug.c\
- defont.c\
- draw.c\
- drawrepl.c\
- egetrect.c\
- ellipse.c\
- emenuhit.c\
- event.c\
- fmt.c\
- font.c\
- freesubfont.c\
- getdefont.c\
- getrect.c\
- getsubfont.c\
- icossin.c\
- icossin2.c\
- init.c\
- keyboard.c\
- line.c\
- menuhit.c\
- mkfont.c\
- mouse.c\
- newwindow.c\
- openfont.c\
- poly.c\
- loadimage.c\
- readcolmap.c\
- readimage.c\
- readsubfont.c\
- rectclip.c\
- replclipr.c\
- rgb.c\
- scroll.c\
- string.c\
- stringbg.c\
- stringsubfont.c\
- stringwidth.c\
- subfont.c\
- subfontcache.c\
- subfontname.c\
- unloadimage.c\
- window.c\
- writecolmap.c\
- writeimage.c\
- writesubfont.c\
- "
- BUILD_OUT="${LIB_DIR}/klibdraw.a"
- CLEAN_COM="rm -f *.o"
- }
|