add a Makefile hierarchy which builds the whole show
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..103d8cd
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,3 @@
+SUBDIR = libexec got tog regress
+
+.include <bsd.subdir.mk>
diff --git a/Makefile.inc b/Makefile.inc
new file mode 100644
index 0000000..894e86c
--- /dev/null
+++ b/Makefile.inc
@@ -0,0 +1,13 @@
+GOT_LIBEXECDIR = ${HOME}/bin
+
+CFLAGS += -Werror -Wall -Wstrict-prototypes -Wunused-variable
+#CFLAGS += -DGOT_PACK_NO_MMAP
+#CFLAGS += -DGOT_NO_OBJ_CACHE
+
+.if defined(PROFILE)
+CC = gcc
+CPPFLAGS += -DPROFILE
+DEBUG = -O0 -pg
+.else
+DEBUG = -O0 -g
+.endif
diff --git a/got/Makefile b/got/Makefile
index 2f31fc4..e8932c8 100644
--- a/got/Makefile
+++ b/got/Makefile
@@ -6,21 +6,10 @@ SRCS= got.c blame.c commit_graph.c delta.c diff.c diffoffset.c \
object_idset.c object_parse.c opentemp.c path.c pack.c \
privsep.c reference.c repository.c sha1.c worktree.c inflate.c
-GOT_LIBEXECDIR = ${HOME}/bin
CPPFLAGS = -I${.CURDIR}/../include -I${.CURDIR}/../lib \
-DGOT_LIBEXECDIR=${GOT_LIBEXECDIR}
LDADD = -lutil -lz
DPADD = ${LIBZ} ${LIBUTIL}
-.if defined(PROFILE)
-CC = gcc
-CPPFLAGS += -DPROFILE
-DEBUG = -O0 -pg
-.else
-DEBUG = -O0 -g
-.endif
-CFLAGS += -Werror -Wall -Wstrict-prototypes -Wunused-variable
-#CFLAGS += -DGOT_PACK_NO_MMAP
-#CFLAGS += -DGOT_NO_OBJ_CACHE
# For now, default to installing binary in ~/bin
GROUP!=id -g -n
diff --git a/libexec/Makefile b/libexec/Makefile
new file mode 100644
index 0000000..33f7998
--- /dev/null
+++ b/libexec/Makefile
@@ -0,0 +1,3 @@
+SUBDIR = got-read-blob got-read-commit got-read-object got-read-tree
+
+.include <bsd.subdir.mk>
diff --git a/libexec/Makefile.inc b/libexec/Makefile.inc
new file mode 100644
index 0000000..01b5f23
--- /dev/null
+++ b/libexec/Makefile.inc
@@ -0,0 +1 @@
+.include "../Makefile.inc"
diff --git a/libexec/got-read-blob/Makefile b/libexec/got-read-blob/Makefile
index 261f1cc..564acd4 100644
--- a/libexec/got-read-blob/Makefile
+++ b/libexec/got-read-blob/Makefile
@@ -7,23 +7,12 @@ SRCS= got-read-blob.c delta.c error.c inflate.c object_parse.c \
CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
LDADD = -lutil -lz
DPADD = ${LIBZ} ${LIBUTIL}
-.if defined(PROFILE)
-CC = gcc
-CPPFLAGS += -DPROFILE
-DEBUG = -O0 -pg
-.else
-DEBUG = -O0 -g
-.endif
-CFLAGS += -Werror -Wall -Wstrict-prototypes -Wunused-variable
-#CFLAGS += -DGOT_PACK_NO_MMAP
-#CFLAGS += -DGOT_NO_OBJ_CACHE
# For now, default to installing binary in ~/bin
-LIBEXECDIR = ${HOME}/bin
GROUP!=id -g -n
install:
${INSTALL} ${INSTALL_COPY} -o ${USER} -g ${GROUP} \
- -m ${BINMODE} ${PROG} ${LIBEXECDIR}/${PROG}
+ -m ${BINMODE} ${PROG} ${GOT_LIBEXECDIR}/${PROG}
# Don't install man pages yet
NOMAN = Yes
diff --git a/libexec/got-read-commit/Makefile b/libexec/got-read-commit/Makefile
index fe09198..1470f72 100644
--- a/libexec/got-read-commit/Makefile
+++ b/libexec/got-read-commit/Makefile
@@ -7,23 +7,12 @@ SRCS= got-read-commit.c delta.c error.c inflate.c object_parse.c \
CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
LDADD = -lutil -lz
DPADD = ${LIBZ} ${LIBUTIL}
-.if defined(PROFILE)
-CC = gcc
-CPPFLAGS += -DPROFILE
-DEBUG = -O0 -pg
-.else
-DEBUG = -O0 -g
-.endif
-CFLAGS += -Werror -Wall -Wstrict-prototypes -Wunused-variable
-#CFLAGS += -DGOT_PACK_NO_MMAP
-#CFLAGS += -DGOT_NO_OBJ_CACHE
# For now, default to installing binary in ~/bin
-LIBEXECDIR = ${HOME}/bin
GROUP!=id -g -n
install:
${INSTALL} ${INSTALL_COPY} -o ${USER} -g ${GROUP} \
- -m ${BINMODE} ${PROG} ${LIBEXECDIR}/${PROG}
+ -m ${BINMODE} ${PROG} ${GOT_LIBEXECDIR}/${PROG}
# Don't install man pages yet
NOMAN = Yes
diff --git a/libexec/got-read-object/Makefile b/libexec/got-read-object/Makefile
index 71a0ac8..9cb00e1 100644
--- a/libexec/got-read-object/Makefile
+++ b/libexec/got-read-object/Makefile
@@ -7,23 +7,12 @@ SRCS= got-read-object.c delta.c error.c inflate.c object_parse.c \
CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
LDADD = -lutil -lz
DPADD = ${LIBZ} ${LIBUTIL}
-.if defined(PROFILE)
-CC = gcc
-CPPFLAGS += -DPROFILE
-DEBUG = -O0 -pg
-.else
-DEBUG = -O0 -g
-.endif
-CFLAGS += -Werror -Wall -Wstrict-prototypes -Wunused-variable
-#CFLAGS += -DGOT_PACK_NO_MMAP
-#CFLAGS += -DGOT_NO_OBJ_CACHE
# For now, default to installing binary in ~/bin
-LIBEXECDIR = ${HOME}/bin
GROUP!=id -g -n
install:
${INSTALL} ${INSTALL_COPY} -o ${USER} -g ${GROUP} \
- -m ${BINMODE} ${PROG} ${LIBEXECDIR}/${PROG}
+ -m ${BINMODE} ${PROG} ${GOT_LIBEXECDIR}/${PROG}
# Don't install man pages yet
NOMAN = Yes
diff --git a/libexec/got-read-tree/Makefile b/libexec/got-read-tree/Makefile
index c6079e3..600541d 100644
--- a/libexec/got-read-tree/Makefile
+++ b/libexec/got-read-tree/Makefile
@@ -7,23 +7,12 @@ SRCS= got-read-tree.c delta.c error.c inflate.c object_parse.c \
CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
LDADD = -lutil -lz
DPADD = ${LIBZ} ${LIBUTIL}
-.if defined(PROFILE)
-CC = gcc
-CPPFLAGS += -DPROFILE
-DEBUG = -O0 -pg
-.else
-DEBUG = -O0 -g
-.endif
-CFLAGS += -Werror -Wall -Wstrict-prototypes -Wunused-variable
-#CFLAGS += -DGOT_PACK_NO_MMAP
-#CFLAGS += -DGOT_NO_OBJ_CACHE
# For now, default to installing binary in ~/bin
-LIBEXECDIR = ${HOME}/bin
GROUP!=id -g -n
install:
${INSTALL} ${INSTALL_COPY} -o ${USER} -g ${GROUP} \
- -m ${BINMODE} ${PROG} ${LIBEXECDIR}/${PROG}
+ -m ${BINMODE} ${PROG} ${GOT_LIBEXECDIR}/${PROG}
# Don't install man pages yet
NOMAN = Yes
diff --git a/regress/Makefile b/regress/Makefile
new file mode 100644
index 0000000..31e2dae
--- /dev/null
+++ b/regress/Makefile
@@ -0,0 +1,3 @@
+SUBDIR = delta idset repository worktree
+
+.include <bsd.subdir.mk>
diff --git a/regress/Makefile.inc b/regress/Makefile.inc
new file mode 100644
index 0000000..01b5f23
--- /dev/null
+++ b/regress/Makefile.inc
@@ -0,0 +1 @@
+.include "../Makefile.inc"
diff --git a/regress/delta/Makefile b/regress/delta/Makefile
index 4f7ab90..f616387 100644
--- a/regress/delta/Makefile
+++ b/regress/delta/Makefile
@@ -5,8 +5,6 @@ SRCS = delta.c error.c opentemp.c path.c inflate.c delta_test.c
CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
LDADD = -lz
-DEBUG = -O0 -g
-CFLAGS += -Werror -Wall -Wstrict-prototypes -Wunused-variable
NOMAN = yes
diff --git a/regress/idset/Makefile b/regress/idset/Makefile
index b4eade2..2b4ff87 100644
--- a/regress/idset/Makefile
+++ b/regress/idset/Makefile
@@ -7,8 +7,6 @@ SRCS = error.c object.c privsep.c sha1.c pack.c inflate.c path.c opentemp.c \
CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
LDADD = -lutil -lz
-DEBUG = -O0 -g
-CFLAGS += -Werror -Wall -Wstrict-prototypes -Wunused-variable
NOMAN = yes
diff --git a/regress/repository/Makefile b/regress/repository/Makefile
index 2ee86e3..babe389 100644
--- a/regress/repository/Makefile
+++ b/regress/repository/Makefile
@@ -6,14 +6,9 @@ SRCS = path.c repository.c error.c reference.c object.c object_idcache.c \
pack.c privsep.c delta.c fileindex.c worktree.c inflate.c \
repository_test.c
-GOT_LIBEXECDIR = ${HOME}/bin
CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib \
-DGOT_LIBEXECDIR=${GOT_LIBEXECDIR}
LDADD = -lutil -lz
-DEBUG = -O0 -g
-CFLAGS += -Werror -Wall -Wstrict-prototypes -Wunused-variable
-#CFLAGS += -DGOT_PACK_NO_MMAP
-#CFLAGS += -DGOT_NO_OBJ_CACHE
NOMAN = yes
diff --git a/regress/worktree/Makefile b/regress/worktree/Makefile
index 1819712..c4b341e 100644
--- a/regress/worktree/Makefile
+++ b/regress/worktree/Makefile
@@ -5,14 +5,9 @@ SRCS = worktree.c repository.c object.c object_idcache.c object_idset.c \
object_parse.c opentemp.c path.c error.c reference.c sha1.c pack.c \
privsep.c delta.c inflate.c fileindex.c worktree_test.c
-GOT_LIBEXECDIR = ${HOME}/bin
CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib \
-DGOT_LIBEXECDIR=${GOT_LIBEXECDIR}
LDADD = -lutil -lz
-DEBUG = -O0 -g
-CFLAGS += -Werror -Wall -Wstrict-prototypes -Wunused-variable
-#CFLAGS += -DGOT_PACK_NO_MMAP
-#CFLAGS += -DGOT_NO_OBJ_CACHE
NOMAN = yes
diff --git a/tog/Makefile b/tog/Makefile
index a3a05e3..ae6ee69 100644
--- a/tog/Makefile
+++ b/tog/Makefile
@@ -7,21 +7,10 @@ SRCS= tog.c blame.c commit_graph.c delta.c diff.c diffoffset.c \
privsep.c reference.c repository.c sha1.c worktree.c \
utf8.c inflate.c
-GOT_LIBEXECDIR = ${HOME}/bin
CPPFLAGS = -I${.CURDIR}/../include -I${.CURDIR}/../lib \
-DGOT_LIBEXECDIR=${GOT_LIBEXECDIR}
LDADD = -lpanel -lncursesw -lutil -lz -lpthread
DPADD = ${LIBZ} ${LIBUTIL}
-.if defined(PROFILE)
-CC = gcc
-CPPFLAGS += -DPROFILE
-DEBUG = -O0 -pg
-.else
-DEBUG = -O0 -g
-.endif
-CFLAGS += -Werror -Wall -Wstrict-prototypes -Wunused-variable
-#CFLAGS += -DGOT_PACK_NO_MMAP
-#CFLAGS += -DGOT_NO_OBJ_CACHE
# For now, default to installing binary in ~/bin
GROUP!=id -g -n