|
| 1 | +</sys/src/ape/config |
| 2 | + |
| 3 | +CFILES=`{sed -n '/^BUILTIN_OBJS *\+= *(.*)\.o$/s//\1.c/p' Makefile} |
| 4 | +OFILES=\ |
| 5 | + ${CFILES:%.c=%.$O}\ |
| 6 | + common-main.$O\ |
| 7 | +
|
| 8 | +X_CFILES=`{sed -n '/^BUILT_INS *\+= *git-(.*)\$X$/s//\1/p' Makefile} |
| 9 | + |
| 10 | +#APP_CFILES=`{sed -n '/^PROGRAM_OBJS *\+= *(.*)\.o$/s//\1.c/p' Makefile} |
| 11 | +APP_CFILES=\ |
| 12 | + credential-store.c\ |
| 13 | + http-fetch.c\ |
| 14 | + http-push.c\ |
| 15 | + |
| 16 | +TARG=\ |
| 17 | + git\ |
| 18 | + ${CFILES:builtin/%.c=git-%}\ |
| 19 | + ${X_CFILES:%=git-%}\ |
| 20 | + ${APP_CFILES:%.c=git-%}\ |
| 21 | + git-remote-http\ |
| 22 | + git-remote-https\ |
| 23 | + git-remote-ftp\ |
| 24 | + git-remote-ftps\ |
| 25 | + |
| 26 | +# NO_UNIXSOCK |
| 27 | +# git-credential-cache\ |
| 28 | +# git-credential-cache--daemon\ |
| 29 | +
|
| 30 | +#GIT_HOST_CPU=i386|i686|x86_64 |
| 31 | + |
| 32 | +ROOT=`{pwd} |
| 33 | +<GIT-VERSION-FILE |
| 34 | +COMMIT_HASH=`{git rev-parse -q --verify HEAD} |
| 35 | + |
| 36 | +# -w flag isn't intentionally set because it is noisy. |
| 37 | +# -T flag isn't intentionally set. |
| 38 | +CFLAGS=-FVB+ -c\ |
| 39 | + -I$ROOT\ |
| 40 | + -I$ROOT/compat/plan9\ |
| 41 | + -I$ROOT/compat/regex\ |
| 42 | + -D__PLAN9__\ |
| 43 | + -D_POSIX_SOURCE\ |
| 44 | + -D_BSD_EXTENSION\ |
| 45 | + -D_SUSV2_SOURCE\ |
| 46 | + -D_PLAN9_SOURCE\ |
| 47 | + -D_RESEARCH_SOURCE\ |
| 48 | + -D_REENTRANT_SOURCE\ |
| 49 | + -DHAVE_SOCK_OPTS\ |
| 50 | + -DNO_NSEC\ |
| 51 | + -DNO_SYMLINK_HEAD\ |
| 52 | + -DNO_GECOS_IN_PWENT\ |
| 53 | + -DNO_GETTEXT\ |
| 54 | + -DNO_STRCASESTR\ |
| 55 | + -DNO_STRLCPY\ |
| 56 | + -DNO_STRTOUMAX\ |
| 57 | + -DNO_MBSUPPORT\ |
| 58 | + -DNO_MKDTEMP\ |
| 59 | + -DNO_UNSETENV\ |
| 60 | + -DNEEDS_SYS_PARAM_H\ |
| 61 | + -DNO_INITGROUPS\ |
| 62 | + -DNO_MMAP\ |
| 63 | + -DNO_ST_BLOCKS_IN_STRUCT_STAT\ |
| 64 | + -DNO_STRUCT_ITIMERVAL\ |
| 65 | + -DNO_SETITIMER\ |
| 66 | + -Dsockaddr_storage=sockaddr_in6\ |
| 67 | + -DNO_UNIX_SOCKETS\ |
| 68 | + -DNO_ICONV\ |
| 69 | + -DSHA1_OPENSSL\ |
| 70 | + -DSHA256_OPENSSL\ |
| 71 | + -DNO_MEMMEM\ |
| 72 | + -DHAVE_STDBOOL_H\ |
| 73 | + -DHAVE_STDINT_H\ |
| 74 | + -DHAVE_LOCALE_H\ |
| 75 | + -DHAVE_CLOCK_GETTIME\ |
| 76 | + -DGIT_VERSION="$GIT_VERSION"\ |
| 77 | + -DGIT_BUILT_FROM_COMMIT="$COMMIT_HASH"\ |
| 78 | + -DGIT_USER_AGENT="git/$GIT_VERSION"\ |
| 79 | + -DETC_GITCONFIG="/sys/lib/git/config"\ |
| 80 | + -DETC_GITATTRIBUTES="/sys/lib/git/attributes"\ |
| 81 | + -DUSER_GITCONFIG="~/lib/git/config"\ |
| 82 | + -DUSER_GITCREDENTIALS="~/lib/git/credentials"\ |
| 83 | + -DUSER_GITCREDENTIAL_CACHE="~/lib/git/credential-cache"\ |
| 84 | + -DDEFAULT_GIT_TEMPLATE_DIR="/sys/lib/git/templates"\ |
| 85 | + -DGIT_HOST_CPU="i386"\ |
| 86 | + -DGIT_EXEC_PATH="/bin/git-core"\ |
| 87 | + -DGIT_MAN_PATH="/sys/man"\ |
| 88 | + -DGIT_INFO_PATH=""\ |
| 89 | + -DGIT_HTML_PATH=""\ |
| 90 | + -DFALLBACK_RUNTIME_PREFIX="/bin/git-core"\ |
| 91 | + -DDEFAULT_PAGER="/bin/p"\ |
| 92 | + -DPAGER_ENV="terminal="\ |
| 93 | + -DHOME_ENVIRONMENT="home"\ |
| 94 | + -DPATH_ENVIRONMENT="path"\ |
| 95 | + -D_PATH_SEP=1\ |
| 96 | + -D_PATH_DEFPATH="/bin"\ |
| 97 | + -DSHELL_PATH="/bin/rc"\ |
| 98 | + |
| 99 | +LIB_CFILES=`{sed -n '/^LIB_OBJS *\+= *(.*)\.o$/s//\1.c/p' Makefile} |
| 100 | +LIB_OFILES=\ |
| 101 | + ${LIB_CFILES:%.c=%.$O}\ |
| 102 | + compat/qsort_s.$O\ |
| 103 | + compat/strcasestr.$O\ |
| 104 | + compat/strlcpy.$O\ |
| 105 | + compat/strtoumax.$O\ |
| 106 | + compat/strtoimax.$O\ |
| 107 | + compat/setenv.$O\ |
| 108 | + compat/mkdtemp.$O\ |
| 109 | + compat/unsetenv.$O\ |
| 110 | + compat/mmap.$O\ |
| 111 | + compat/memmem.$O\ |
| 112 | + compat/regex/regex.$O\ |
| 113 | +
|
| 114 | +XDIFF_CFILES=`{sed -n '/^XDIFF_OBJS *\+= *(.*)\.o$/s//\1.c/p' Makefile} |
| 115 | +XDIFF_OFILES=${XDIFF_CFILES:%.c=%.$O} |
| 116 | + |
| 117 | +HFILES=\ |
| 118 | + `{ls *.h}\ |
| 119 | + `{ls */*.h}\ |
| 120 | + `{ls */*/*.h}\ |
| 121 | + `{ls */*/*/*.h}\ |
| 122 | + command-list.h\ |
| 123 | + |
| 124 | +BIN=/$objtype/bin/git-core |
| 125 | +OBJBIN=/$objtype/bin |
| 126 | + |
| 127 | +LIB=\ |
| 128 | + libgit.a$O\ |
| 129 | + xdiff/lib.a$O\ |
| 130 | + /$objtype/lib/ape/libcurl.a\ |
| 131 | + /$objtype/lib/ape/libssl.a\ |
| 132 | + /$objtype/lib/ape/libcrypto.a\ |
| 133 | + /$objtype/lib/ape/libexpat.a\ |
| 134 | + /$objtype/lib/ape/libz.a\ |
| 135 | + |
| 136 | +CLEANFILES=command-list.h |
| 137 | + |
| 138 | +</sys/src/cmd/mkmany |
| 139 | + |
| 140 | +LIBGIT=libgit.a$O |
| 141 | +LIBGITOBJ=${LIB_OFILES:%=$LIBGIT(%)} |
| 142 | +LIBXDIFF=xdiff/lib.a$O |
| 143 | +LIBXDIFFOBJ=${XDIFF_OFILES:%=$LIBXDIFF(%)} |
| 144 | + |
| 145 | +command-list.h:D: command-list.txt |
| 146 | + rc ./generate-cmdlist.rc $prereq >$target |
| 147 | + |
| 148 | +${CFILES:builtin/%.c=$O.git-%} ${X_CFILES:%=$O.git-%}:D: plan9/wrap.c |
| 149 | + for(i in $target) |
| 150 | + $CC -FTVw -o $i $prereq |
| 151 | + |
| 152 | +$O.git-credential-store: credential-store.$O common-main.$O $LIB |
| 153 | + $LD $LDFLAGS -o $target $prereq |
| 154 | + |
| 155 | +$O.git-http-fetch: http-fetch.$O http.$O http-walker.$O common-main.$O $LIB |
| 156 | + $LD $LDFLAGS -o $target $prereq |
| 157 | + |
| 158 | +$O.git-http-push: http-push.$O http.$O common-main.$O $LIB |
| 159 | + $LD $LDFLAGS -o $target $prereq |
| 160 | + |
| 161 | +git-http-%.$O: http-%.c |
| 162 | + $CC $CFLAGS -o $target $prereq |
| 163 | + |
| 164 | +$O.git-remote-http: remote-curl.$O http.$O http-walker.$O common-main.$O $LIB |
| 165 | + $LD $LDFLAGS -o $target $prereq |
| 166 | + |
| 167 | +$O.git-remote-https: remote-curl.$O http.$O http-walker.$O common-main.$O $LIB |
| 168 | + $LD $LDFLAGS -o $target $prereq |
| 169 | + |
| 170 | +$O.git-remote-ftp: remote-curl.$O http.$O http-walker.$O common-main.$O $LIB |
| 171 | + $LD $LDFLAGS -o $target $prereq |
| 172 | + |
| 173 | +$O.git-remote-ftps: remote-curl.$O http.$O http-walker.$O common-main.$O $LIB |
| 174 | + $LD $LDFLAGS -o $target $prereq |
| 175 | + |
| 176 | +# git should be copied into both $BIN and $OBJBIN |
| 177 | +git.install:V: $O.git |
| 178 | + cp $O.git $OBJBIN/git |
| 179 | + |
| 180 | +$LIBGIT: $LIBGITOBJ |
| 181 | + ar vu $target $newmember |
| 182 | + |
| 183 | +$LIBXDIFF: $LIBXDIFFOBJ |
| 184 | + ar vu $target $newmember |
| 185 | + |
| 186 | +%.$O: %.c |
| 187 | + $CC $CFLAGS -o $target $stem.c |
| 188 | + |
| 189 | +$LIBGIT(%.$O):N: %.$O |
| 190 | + |
| 191 | +$LIBXDIFF(%.$O):N: %.$O |
| 192 | + |
| 193 | +clean:V: |
| 194 | + rm -f *.[$OS] [$OS].out y.tab.? lex.yy.c y.debug y.output $CLEANFILES |
| 195 | + rm -f */*.[$OS] */*/*.[$OS] |
0 commit comments