This repository has been archived by the owner on Oct 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Lib_rules.mk
38 lines (30 loc) · 1.56 KB
/
Lib_rules.mk
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
#* ************************************************************************** *#
#* *#
#* ::: :::::::: *#
#* Lib_rules.mk :+: :+: :+: *#
#* +:+ +:+ +:+ *#
#* By: mgautier <mgautier@student.42.fr> +#+ +:+ +#+ *#
#* +#+#+#+#+#+ +#+ *#
#* Created: 2017/11/02 14:18:27 by mgautier #+# #+# *#
#* Updated: 2018/01/10 15:16:15 by mgautier ### ########.fr *#
#* *#
#* ************************************************************************** *#
.LIBPATTERNS= lib%.a lib%.so
define Lib_rule_specific
$(target).$2: $(objects)
$(QUIET) $$(LINK_LIB)
$(target): $(target).$2
$(target).$2: include := $(compile_time_include)
$(target).$2: cflags := $(cflags)\
$(if $(findstring $(shared_lib_suffix),$2),\
$(shared_lib_compile_flags),$(static_lib_compile_flags))
$(objects): $(obj_dir)%$(obj_suffix):$(src_dir)%$(src_suffix) | $(obj_dir)
$(QUIET) $$(COMPILE)
endef
define Lib_rule
$(call Lib_rule_specific,$1,$(static_lib_suffix))
vpath $(TARGET_$1).$(static_lib_suffix) $1
endef
#suffix_list$1:= $(suffix_list$1) $(shared_lib_suffix) $(static_lib_suffix)
#$(call Lib_rule_specific,$1,$(shared_lib_suffix))
#vpath $(TARGET$1).$(shared_lib_suffix) $1