deps.mk 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  1. # Copyright (c) 2013-2015, Loïc Hoguin <essen@ninenines.eu>
  2. # This file is part of erlang.mk and subject to the terms of the ISC License.
  3. .PHONY: distclean-deps distclean-pkg pkg-list pkg-search
  4. # Configuration.
  5. IGNORE_DEPS ?=
  6. DEPS_DIR ?= $(CURDIR)/deps
  7. export DEPS_DIR
  8. REBAR_DEPS_DIR = $(DEPS_DIR)
  9. export REBAR_DEPS_DIR
  10. ALL_DEPS_DIRS = $(addprefix $(DEPS_DIR)/,$(filter-out $(IGNORE_DEPS),$(DEPS)))
  11. ifeq ($(filter $(DEPS_DIR),$(subst :, ,$(ERL_LIBS))),)
  12. ifeq ($(ERL_LIBS),)
  13. ERL_LIBS = $(DEPS_DIR)
  14. else
  15. ERL_LIBS := $(ERL_LIBS):$(DEPS_DIR)
  16. endif
  17. endif
  18. export ERL_LIBS
  19. PKG_FILE2 ?= $(CURDIR)/.erlang.mk.packages.v2
  20. export PKG_FILE2
  21. PKG_FILE_URL ?= https://raw.githubusercontent.com/ninenines/erlang.mk/master/packages.v2.tsv
  22. # Verbosity.
  23. dep_verbose_0 = @echo " DEP " $(1);
  24. dep_verbose = $(dep_verbose_$(V))
  25. # Core targets.
  26. ifneq ($(SKIP_DEPS),)
  27. deps::
  28. else
  29. deps:: $(ALL_DEPS_DIRS)
  30. @for dep in $(ALL_DEPS_DIRS) ; do \
  31. if [ -f $$dep/GNUmakefile ] || [ -f $$dep/makefile ] || [ -f $$dep/Makefile ] ; then \
  32. $(MAKE) -C $$dep IS_DEP=1 || exit $$? ; \
  33. else \
  34. echo "ERROR: No Makefile to build dependency $$dep." ; \
  35. exit 1 ; \
  36. fi ; \
  37. done
  38. endif
  39. distclean:: distclean-deps distclean-pkg
  40. # Deps related targets.
  41. # @todo rename GNUmakefile and makefile into Makefile first, if they exist
  42. # While Makefile file could be GNUmakefile or makefile,
  43. # in practice only Makefile is needed so far.
  44. define dep_autopatch
  45. if [ -f $(DEPS_DIR)/$(1)/Makefile ]; then \
  46. if [ 0 != `grep -c "include ../\w*\.mk" $(DEPS_DIR)/$(1)/Makefile` ]; then \
  47. $(call dep_autopatch2,$(1)); \
  48. elif [ 0 != `grep -ci rebar $(DEPS_DIR)/$(1)/Makefile` ]; then \
  49. $(call dep_autopatch2,$(1)); \
  50. elif [ 0 != `find $(DEPS_DIR)/$(1)/ -type f -name \*.mk -not -name erlang.mk | xargs grep -ci rebar` ]; then \
  51. $(call dep_autopatch2,$(1)); \
  52. else \
  53. $(call dep_autopatch_erlang_mk,$(1)); \
  54. fi \
  55. else \
  56. if [ ! -d $(DEPS_DIR)/$(1)/src/ ]; then \
  57. $(call dep_autopatch_noop,$(1)); \
  58. else \
  59. $(call dep_autopatch2,$(1)); \
  60. fi \
  61. fi
  62. endef
  63. define dep_autopatch2
  64. if [ -f $(DEPS_DIR)/$(1)/rebar.config.script ]; then \
  65. $(call dep_autopatch_rebar_script,$(1)); \
  66. $(call dep_autopatch_rebar,$(1)); \
  67. elif [ -f $(DEPS_DIR)/$(1)/rebar.config ]; then \
  68. $(call dep_autopatch_rebar,$(1)); \
  69. else \
  70. $(call dep_autopatch_gen,$(1)); \
  71. fi
  72. endef
  73. define dep_autopatch_noop
  74. printf "noop:\n" > $(DEPS_DIR)/$(1)/Makefile
  75. endef
  76. # Overwrite erlang.mk with the current file by default.
  77. ifeq ($(NO_AUTOPATCH_ERLANG_MK),)
  78. define dep_autopatch_erlang_mk
  79. rm -f $(DEPS_DIR)/$(1)/erlang.mk; \
  80. cd $(DEPS_DIR)/$(1)/ && ln -s ../../erlang.mk; \
  81. $(call erlang,$(call dep_autopatch_appsrc.erl,$(1)))
  82. endef
  83. else
  84. define dep_autopatch_erlang_mk
  85. $(call erlang,$(call dep_autopatch_appsrc.erl,$(1)))
  86. endef
  87. endif
  88. define dep_autopatch_gen
  89. printf "%s\n" \
  90. "ERLC_OPTS = +debug_info" \
  91. "include ../../erlang.mk" > $(DEPS_DIR)/$(1)/Makefile; \
  92. $(call erlang,$(call dep_autopatch_appsrc.erl,$(1)))
  93. endef
  94. define dep_autopatch_rebar_script
  95. mv $(DEPS_DIR)/$(1)/rebar.config.script $(DEPS_DIR)/$(1)/rebar.config.script.orig; \
  96. sed -r 's/rebar_utils:is_arch\((.*)\)/\1 =:= "$(PLATFORM)"/g' $(DEPS_DIR)/$(1)/rebar.config.script.orig \
  97. > $(DEPS_DIR)/$(1)/rebar.config.script
  98. endef
  99. define dep_autopatch_rebar
  100. if [ -f $(DEPS_DIR)/$(1)/Makefile ]; then \
  101. mv $(DEPS_DIR)/$(1)/Makefile $(DEPS_DIR)/$(1)/Makefile.orig.mk; \
  102. fi; \
  103. $(call erlang,$(call dep_autopatch_rebar.erl,$(1))); \
  104. $(call erlang,$(call dep_autopatch_appsrc.erl,$(1)))
  105. endef
  106. define dep_autopatch_rebar.erl
  107. Conf1 = case file:consult("$(DEPS_DIR)/$(1)/rebar.config") of
  108. {ok, Conf0} -> Conf0;
  109. _ -> []
  110. end,
  111. Conf = case filelib:is_file("$(DEPS_DIR)/$(1)/rebar.config.script") of
  112. false -> Conf1;
  113. true ->
  114. Bindings0 = erl_eval:new_bindings(),
  115. Bindings1 = erl_eval:add_binding('CONFIG', Conf1, Bindings0),
  116. Bindings = erl_eval:add_binding('SCRIPT', "$(DEPS_DIR)/$(1)/rebar.config.script", Bindings1),
  117. {ok, Conf2} = file:script("$(DEPS_DIR)/$(1)/rebar.config.script", Bindings),
  118. Conf2
  119. end,
  120. Write = fun (Text) ->
  121. file:write_file("$(DEPS_DIR)/$(1)/Makefile", Text, [append])
  122. end,
  123. Escape = fun (Text) ->
  124. re:replace(Text, "\\\\$$$$", "\$$$$$$$$", [global, {return, list}])
  125. end,
  126. Write("IGNORE_DEPS = edown eper eunit_formatters meck "
  127. "rebar_lock_deps_plugin rebar_vsn_plugin reltool_util\n\n"),
  128. fun() ->
  129. Write("ERLC_OPTS = +debug_info\n"),
  130. case lists:keyfind(erl_opts, 1, Conf) of
  131. false -> ok;
  132. {_, ErlOpts} ->
  133. lists:foreach(fun
  134. ({d, D}) ->
  135. Write("ERLC_OPTS += -D" ++ atom_to_list(D) ++ "=1\n");
  136. ({platform_define, Regex, D}) ->
  137. case re:run("$(PLATFORM)", Regex, [{capture, none}]) of
  138. nomatch -> ok;
  139. match ->
  140. Write("ERLC_OPTS += -D" ++ atom_to_list(D) ++ "=1\n")
  141. end;
  142. ({parse_transform, PT}) ->
  143. Write("ERLC_OPTS += +'{parse_transform, " ++ atom_to_list(PT) ++ "}'\n");
  144. (_) -> ok
  145. end, ErlOpts)
  146. end,
  147. Write("\n")
  148. end(),
  149. fun() ->
  150. File = case lists:keyfind(deps, 1, Conf) of
  151. false -> [];
  152. {_, Deps} ->
  153. [begin
  154. Name = element(1, Dep),
  155. {Method, Repo, Commit} = case element(3, Dep) of
  156. {git, R} -> {git, R, master};
  157. {M, R, {branch, C}} -> {M, R, C};
  158. {M, R, {tag, C}} -> {M, R, C};
  159. {M, R, C} -> {M, R, C}
  160. end,
  161. Write(io_lib:format("DEPS += ~s\ndep_~s = ~s ~s ~s~n", [Name, Name, Method, Repo, Commit]))
  162. end || Dep <- Deps, tuple_size(Dep) > 2]
  163. end
  164. end(),
  165. fun() ->
  166. First = case lists:keyfind(erl_first_files, 1, Conf) of false -> []; {_, Files} ->
  167. Names = [[" ", begin "lre." ++ Elif = lists:reverse(F), lists:reverse(Elif) end]
  168. || "src/" ++ F <- Files],
  169. Write(io_lib:format("COMPILE_FIRST +=~s\n", [Names]))
  170. end
  171. end(),
  172. FindFirst = fun(F, Fd) ->
  173. case io:parse_erl_form(Fd, undefined) of
  174. {ok, {attribute, _,compile, {parse_transform, PT}}, _} ->
  175. [PT, F(F, Fd)];
  176. {ok, {attribute, _, include, Hrl}, _} ->
  177. case file:open("$(DEPS_DIR)/$(1)/include/" ++ Hrl, [read]) of
  178. {ok, HrlFd} -> [F(F, HrlFd), F(F, Fd)];
  179. _ ->
  180. case file:open("$(DEPS_DIR)/$(1)/src/" ++ Hrl, [read]) of
  181. {ok, HrlFd} -> [F(F, HrlFd), F(F, Fd)];
  182. _ -> [F(F, Fd)]
  183. end
  184. end;
  185. {ok, {attribute, _, include_lib, "$(1)/include/" ++ Hrl}, _} ->
  186. {ok, HrlFd} = file:open("$(DEPS_DIR)/$(1)/include/" ++ Hrl, [read]),
  187. [F(F, HrlFd), F(F, Fd)];
  188. {ok, {attribute, _, import, {Imp, _}}, _} ->
  189. case file:open("$(DEPS_DIR)/$(1)/src/" ++ atom_to_list(Imp) ++ ".erl", [read]) of
  190. {ok, ImpFd} -> [Imp, F(F, ImpFd), F(F, Fd)];
  191. _ -> [F(F, Fd)]
  192. end;
  193. {eof, _} ->
  194. file:close(Fd),
  195. [];
  196. _ ->
  197. F(F, Fd)
  198. end
  199. end,
  200. fun() ->
  201. ErlFiles = filelib:wildcard("$(DEPS_DIR)/$(1)/src/*.erl"),
  202. First0 = lists:usort(lists:flatten([begin
  203. {ok, Fd} = file:open(F, [read]),
  204. FindFirst(FindFirst, Fd)
  205. end || F <- ErlFiles])),
  206. First = lists:flatten([begin
  207. {ok, Fd} = file:open("$(DEPS_DIR)/$(1)/src/" ++ atom_to_list(M) ++ ".erl", [read]),
  208. FindFirst(FindFirst, Fd)
  209. end || M <- First0, lists:member("$(DEPS_DIR)/$(1)/src/" ++ atom_to_list(M) ++ ".erl", ErlFiles)]) ++ First0,
  210. Write(["COMPILE_FIRST +=", [[" ", atom_to_list(M)] || M <- First,
  211. lists:member("$(DEPS_DIR)/$(1)/src/" ++ atom_to_list(M) ++ ".erl", ErlFiles)], "\n"])
  212. end(),
  213. PortSpec = fun(Name, {_, Output, Input, [{env, Env}]}) ->
  214. filelib:ensure_dir("$(DEPS_DIR)/$(1)/" ++ Output),
  215. file:write_file("$(DEPS_DIR)/$(1)/c_src/Makefile." ++ Name, [
  216. [["override ", K, " = $$$$\(shell echo ", Escape(V), "\)\n"]
  217. || {_, K, V} <- Env],
  218. "\nall:\n\t$$$$\(CC\) $$$$\(CFLAGS\) $$$$\(LDLIBS\) $$$$\(LDFLAGS\) ",
  219. "-o $(DEPS_DIR)/$(1)/", Output,
  220. [[" ../", F] || F <- Input]
  221. ])
  222. end,
  223. fun() ->
  224. case filelib:is_dir("$(DEPS_DIR)/$(1)/c_src") of
  225. false -> ok;
  226. true ->
  227. Sources = filelib:fold_files("$(DEPS_DIR)/$(1)/c_src", ".*\\\\.(c|C|cc|cpp)$$$$", true, fun(F, Acc) -> [F|Acc] end, []),
  228. Write(io_lib:format("SOURCES :=~s\n", [[[" ", S] || S <- Sources]]))
  229. end
  230. end(),
  231. fun() ->
  232. case lists:keyfind(port_specs, 1, Conf) of
  233. {_, [{Output, Wildcards}]} ->
  234. filelib:ensure_dir("$(DEPS_DIR)/$(1)/" ++ Output),
  235. Write("C_SRC_OUTPUT = " ++ Escape(Output) ++ "\n"),
  236. Sources = [[[" ", S] || S <- filelib:wildcard("$(DEPS_DIR)/$(1)/" ++ W)] || W <- Wildcards],
  237. Write(io_lib:format("SOURCES :=~s\n", [Sources]));
  238. {_, [First, Second]} ->
  239. PortSpec("1", First),
  240. PortSpec("2", Second),
  241. file:write_file("$(DEPS_DIR)/$(1)/c_src/Makefile",
  242. "all:\n\t$$$$\(MAKE\) -f Makefile.1\n\t$$$$\(MAKE\) -f Makefile.2\n");
  243. _ -> ok
  244. end
  245. end(),
  246. fun() ->
  247. case lists:keyfind(port_env, 1, Conf) of
  248. {_, Vars} ->
  249. lists:foldl(fun
  250. ({K, V}, Acc) ->
  251. case lists:member(K, Acc) of
  252. true -> Acc;
  253. false ->
  254. Write(K ++ " = $$$$\(shell echo " ++ Escape(V) ++ "\)\n"),
  255. [K|Acc]
  256. end;
  257. ({Regex, K, V}, Acc) ->
  258. case lists:member(K, Acc) of
  259. true -> Acc;
  260. false ->
  261. case re:run("$(PLATFORM)", Regex, [{capture, none}]) of
  262. nomatch -> Acc;
  263. match ->
  264. Write(K ++ " = $$$$\(shell echo " ++ Escape(V) ++ "\)\n"),
  265. [K|Acc]
  266. end
  267. end
  268. end, [], Vars),
  269. Write("CFLAGS += $$$$\(DRV_CFLAGS\)\n"),
  270. Write("CXXFLAGS += $$$$\(DRV_CFLAGS\)\n"),
  271. Write("LDFLAGS += $$$$\(DRV_LDFLAGS\)\n");
  272. _ -> ok
  273. end
  274. end(),
  275. Write("\n\nrebar_dep: pre-deps deps pre-app app\n"),
  276. Write("\npre-deps::\n"),
  277. Write("\npre-app::\n"),
  278. fun() ->
  279. case lists:keyfind(pre_hooks, 1, Conf) of
  280. false -> ok;
  281. {_, Hooks} ->
  282. [case H of
  283. {'get-deps', Command} ->
  284. Write("\npre-deps::\n\t" ++ Escape(Command) ++ "\n");
  285. {compile, Command} ->
  286. Write("\npre-app::\n\t" ++ Escape(Command) ++ "\n");
  287. {Regex, compile, Command0} ->
  288. case re:run("$(PLATFORM)", Regex, [{capture, none}]) of
  289. match ->
  290. Command = case Command0 of
  291. "make -C" ++ _ -> Escape(Command0);
  292. "gmake -C" ++ _ -> Escape(Command0);
  293. "make " ++ Command1 -> "make -f Makefile.orig.mk " ++ Escape(Command1);
  294. "gmake " ++ Command1 -> "gmake -f Makefile.orig.mk " ++ Escape(Command1);
  295. _ -> Command0
  296. end,
  297. Write("\npre-app::\n\t" ++ Command ++ "\n");
  298. nomatch ->
  299. ok
  300. end;
  301. _ -> ok
  302. end || H <- Hooks]
  303. end
  304. end(),
  305. Write("\ninclude ../../erlang.mk"),
  306. fun() ->
  307. case filelib:is_dir("$(DEPS_DIR)/$(1)/c_src") of
  308. false -> ok;
  309. true ->
  310. Write("\n\nCFLAGS := $$$$\(filter-out -std=c99 -Wmissing-prototypes,$$$$\(CFLAGS\)\)\n")
  311. end
  312. end(),
  313. fun() ->
  314. case lists:keyfind(plugins, 1, Conf) of
  315. {_, [Plugin]} when is_atom(Plugin) ->
  316. ErlFile = "$(DEPS_DIR)/$(1)/plugins/" ++ atom_to_list(Plugin) ++ ".erl",
  317. try
  318. {ok, PF} = file:read_file(ErlFile),
  319. PF2 = re:replace(PF, "rebar_utils:find_files", "find_files", [global, {return, list}]),
  320. PF3 = PF2 ++ "find_files(Dir, Regex) ->
  321. filelib:fold_files(Dir, Regex, true, fun(F, Acc) -> [F|Acc] end, []).",
  322. ok = file:write_file(ErlFile, PF3),
  323. {ok, Mod, Bin} = compile:file(ErlFile, [binary]),
  324. {module, Mod} = code:load_binary(Mod, ErlFile, Bin),
  325. c:cd("$(DEPS_DIR)/$(1)/"),
  326. ok = Mod:pre_compile(Conf, undefined)
  327. catch _:_ ->
  328. ok
  329. end;
  330. _ -> ok
  331. end
  332. end(),
  333. halt()
  334. endef
  335. define dep_autopatch_appsrc.erl
  336. AppSrcOut = "$(DEPS_DIR)/$(1)/src/$(1).app.src",
  337. AppSrcIn = case filelib:is_regular(AppSrcOut) of false -> "$(DEPS_DIR)/$(1)/ebin/$(1).app"; true -> AppSrcOut end,
  338. case filelib:is_regular(AppSrcIn) of
  339. false -> ok;
  340. true ->
  341. fun() ->
  342. {ok, [{application, $(1), L}]} = file:consult(AppSrcIn),
  343. L2 = case lists:keyfind(modules, 1, L) of {_, _} -> L; false -> [{modules, []}|L] end,
  344. L3 = case lists:keyfind(vsn, 1, L2) of {vsn, git} -> lists:keyreplace(vsn, 1, L2, {vsn, "git"}); _ -> L2 end,
  345. ok = file:write_file(AppSrcOut, io_lib:format("~p.~n", [{application, $(1), L3}]))
  346. end(),
  347. case AppSrcOut of AppSrcIn -> ok; _ -> ok = file:delete(AppSrcIn) end
  348. end,
  349. halt()
  350. endef
  351. define dep_fetch
  352. if [ "$$$$VS" = "git" ]; then \
  353. git clone -q -n -- $$$$REPO $(DEPS_DIR)/$(1); \
  354. cd $(DEPS_DIR)/$(1) && git checkout -q $$$$COMMIT; \
  355. elif [ "$$$$VS" = "hg" ]; then \
  356. hg clone -q -U $$$$REPO $(DEPS_DIR)/$(1); \
  357. cd $(DEPS_DIR)/$(1) && hg update -q $$$$COMMIT; \
  358. elif [ "$$$$VS" = "svn" ]; then \
  359. svn checkout -q $$$$REPO $(DEPS_DIR)/$(1); \
  360. elif [ "$$$$VS" = "cp" ]; then \
  361. cp -R $$$$REPO $(DEPS_DIR)/$(1); \
  362. else \
  363. echo "Unknown or invalid dependency: $(1). Please consult the erlang.mk README for instructions." >&2; \
  364. exit 78; \
  365. fi
  366. endef
  367. define dep_target
  368. $(DEPS_DIR)/$(1):
  369. @mkdir -p $(DEPS_DIR)
  370. ifeq (,$(dep_$(1)))
  371. @if [ ! -f $(PKG_FILE2) ]; then $(call core_http_get,$(PKG_FILE2),$(PKG_FILE_URL)); fi
  372. $(dep_verbose) DEPPKG=$$$$(awk 'BEGIN { FS = "\t" }; $$$$1 == "$(1)" { print $$$$2 " " $$$$3 " " $$$$4 }' $(PKG_FILE2);); \
  373. VS=$$$$(echo $$$$DEPPKG | cut -d " " -f1); \
  374. REPO=$$$$(echo $$$$DEPPKG | cut -d " " -f2); \
  375. COMMIT=$$$$(echo $$$$DEPPKG | cut -d " " -f3); \
  376. $(call dep_fetch,$(1))
  377. else
  378. ifeq (1,$(words $(dep_$(1))))
  379. $(dep_verbose) VS=git; \
  380. REPO=$(dep_$(1)); \
  381. COMMIT=master; \
  382. $(call dep_fetch,$(1))
  383. else
  384. ifeq (2,$(words $(dep_$(1))))
  385. $(dep_verbose) VS=git; \
  386. REPO=$(word 1,$(dep_$(1))); \
  387. COMMIT=$(word 2,$(dep_$(1))); \
  388. $(call dep_fetch,$(1))
  389. else
  390. $(dep_verbose) VS=$(word 1,$(dep_$(1))); \
  391. REPO=$(word 2,$(dep_$(1))); \
  392. COMMIT=$(word 3,$(dep_$(1))); \
  393. $(call dep_fetch,$(1))
  394. endif
  395. endif
  396. endif
  397. @if [ -f $(DEPS_DIR)/$(1)/configure.ac ]; then \
  398. echo " AUTO " $(1); \
  399. cd $(DEPS_DIR)/$(1) && autoreconf -vif; \
  400. fi
  401. -@if [ -f $(DEPS_DIR)/$(1)/configure ]; then \
  402. echo " CONF " $(1); \
  403. cd $(DEPS_DIR)/$(1) && ./configure; \
  404. fi
  405. ifeq ($(filter $(1),$(NO_AUTOPATCH)),)
  406. @$(call dep_autopatch,$(1))
  407. endif
  408. endef
  409. $(foreach dep,$(DEPS),$(eval $(call dep_target,$(dep))))
  410. distclean-deps:
  411. $(gen_verbose) rm -rf $(DEPS_DIR)
  412. # Packages related targets.
  413. $(PKG_FILE2):
  414. @$(call core_http_get,$(PKG_FILE2),$(PKG_FILE_URL))
  415. pkg-list: $(PKG_FILE2)
  416. @cat $(PKG_FILE2) | awk 'BEGIN { FS = "\t" }; { print \
  417. "Name:\t\t" $$1 "\n" \
  418. "Repository:\t" $$3 "\n" \
  419. "Website:\t" $$5 "\n" \
  420. "Description:\t" $$6 "\n" }'
  421. ifdef q
  422. pkg-search: $(PKG_FILE2)
  423. @cat $(PKG_FILE2) | grep -i ${q} | awk 'BEGIN { FS = "\t" }; { print \
  424. "Name:\t\t" $$1 "\n" \
  425. "Repository:\t" $$3 "\n" \
  426. "Website:\t" $$5 "\n" \
  427. "Description:\t" $$6 "\n" }'
  428. else
  429. pkg-search:
  430. $(error Usage: $(MAKE) pkg-search q=STRING)
  431. endif
  432. ifeq ($(PKG_FILE2),$(CURDIR)/.erlang.mk.packages.v2)
  433. distclean-pkg:
  434. $(gen_verbose) rm -f $(PKG_FILE2)
  435. endif
  436. help::
  437. @printf "%s\n" "" \
  438. "Package-related targets:" \
  439. " pkg-list List all known packages" \
  440. " pkg-search q=STRING Search for STRING in the package index"