forked from git-lfs/git-lfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (35 loc) · 1.05 KB
/
Makefile
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
GOC ?= gccgo
AR ?= ar
SRCDIR := $(dir $(lastword $(MAKEFILE_LIST)))
LIBDIR := out/github.com/git-lfs/git-lfs
GOFLAGS := -Iout
ifeq ($(MAKEFILE_GEN),)
MAKEFILE_GEN := out/Makefile.gen
all: $(MAKEFILE_GEN)
@$(MAKE) -f $(lastword $(MAKEFILE_LIST)) $(MAKEFLAGS) MAKEFILE_GEN=$(MAKEFILE_GEN) $@
$(MAKEFILE_GEN) : out/genmakefile $(SRCDIR)commands/mancontent_gen.go
@mkdir -p $(dir $@)
$< "$(SRCDIR)" github.com/git-lfs/git-lfs/ > $@
else
all : bin/git-lfs
include $(MAKEFILE_GEN)
$(LIBDIR)/git-lfs.o : $(SRC_main) $(DEPS_main)
@mkdir -p $(dir $@)
$(GOC) $(GOFLAGS) -c -o $@ $(SRC_main)
bin/git-lfs : $(LIBDIR)/git-lfs.o $(DEPS_main)
@mkdir -p $(dir $@)
$(GOC) $(GOFLAGS) -o $@ $^
%.a : %.o
$(AR) rc $@ $<
endif
$(SRCDIR)commands/mancontent_gen.go : out/mangen
cd $(SRCDIR)commands && $(CURDIR)/out/mangen
out/mangen : $(SRCDIR)docs/man/mangen.go
@mkdir -p $(dir $@)
$(GOC) -o $@ $<
out/genmakefile : $(SRCDIR)script/genmakefile/genmakefile.go
@mkdir -p $(dir $@)
$(GOC) -o $@ $<
clean :
rm -rf out bin
rm -f $(SRCDIR)commands/mancontent_gen.go