Skip to content

Commit 008426c

Browse files
committed
Adding a simple check to reduce number of created issues.
1 parent 337afd6 commit 008426c

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

Makefile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ PACKAGES := capstone freetype2 glfw3 libavcodec libavformat libavutil libswresam
1010

1111
LOCALES := fr
1212

13+
ifeq ($(wildcard third_party/zlib/zlib.h),)
14+
HAS_SUBMODULES = false
15+
else
16+
HAS_SUBMODULES = true
17+
endif
18+
1319
CXXFLAGS += -std=c++2a
1420
CPPFLAGS += `pkg-config --cflags $(PACKAGES)`
1521
CPPFLAGS += -I.
@@ -124,7 +130,16 @@ TESTS := $(patsubst %.cc,%,$(TESTS_SRC))
124130
CP ?= cp
125131
MKDIRP ?= mkdir -p
126132

127-
all: dep $(TARGET)
133+
all: check_submodules dep $(TARGET)
134+
135+
ifeq ($(HAS_SUBMODULES),true)
136+
check_submodules:
137+
138+
else
139+
check_submodules:
140+
@echo "You need to clone this repository recursively, in order to get its submodules."
141+
@false
142+
endif
128143

129144
strip: all
130145
strip $(TARGET)
@@ -229,7 +244,9 @@ dep: $(DEPS)
229244
ifneq ($(MAKECMDGOALS), regen-i18n)
230245
ifneq ($(MAKECMDGOALS), clean)
231246
ifneq ($(MAKECMDGOALS), gitclean)
247+
ifeq ($(HAS_SUBMODULES), true)
232248
-include $(DEPS)
233249
endif
234250
endif
235251
endif
252+
endif

0 commit comments

Comments
 (0)