-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefine.mk
executable file
·130 lines (106 loc) · 3.97 KB
/
define.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
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
CONFIGURED = .configured
.patched:
$(PJ_SH_SED) "s|#define LIBUTILX9_VERSION.*|#define LIBUTILX9_VERSION $(LIBUTILX9_VERSION)|g" utilx9.h
ifeq ("$(PJ_HAS_OPENSSL)", "yes")
$(PJ_SH_SED) "s|#undef UTIL_EX_SSL.*|#define UTIL_EX_SSL|g" utilx9.h
else
$(PJ_SH_SED) "s|#define UTIL_EX_SSL.*|#undef UTIL_EX_SSL|g" utilx9.h
endif
ifeq ("$(PJ_HAS_JANSSON)", "yes")
$(PJ_SH_SED) "s|#undef UTIL_EX_JSON.*|#define UTIL_EX_JSON|g" utilx9.h
else
$(PJ_SH_SED) "s|#define UTIL_EX_JSON.*|#undef UTIL_EX_JSON|g" utilx9.h
endif
ifeq ("$(PJ_HAS_CURL)", "yes")
$(PJ_SH_SED) "s|#undef UTIL_EX_CURL.*|#define UTIL_EX_CURL|g" utilx9.h
else
$(PJ_SH_SED) "s|#define UTIL_EX_CURL.*|#undef UTIL_EX_CURL|g" utilx9.h
endif
ifeq ("$(PJ_HAS_MXML)", "yes")
$(PJ_SH_SED) "s|#undef UTIL_EX_MXML.*|#define UTIL_EX_MXML|g" utilx9.h
else
$(PJ_SH_SED) "s|#define UTIL_EX_MXML.*|#undef UTIL_EX_MXML|g" utilx9.h
endif
ifeq ("$(PJ_HAS_LIBSSH)", "yes")
$(PJ_SH_SED) "s|#undef UTIL_EX_SSH.*|#define UTIL_EX_SSH|g" utilx9.h
else
$(PJ_SH_SED) "s|#define UTIL_EX_SSH.*|#undef UTIL_EX_SSH|g" utilx9.h
endif
ifeq ("$(PJ_HAS_SWCONFIG)", "yes")
$(PJ_SH_SED) "s|#undef UTIL_EX_SWCONFIG.*|#define UTIL_EX_SWCONFIG|g" utilx9.h
else
$(PJ_SH_SED) "s|#define UTIL_EX_SWCONFIG.*|#undef UTIL_EX_SWCONFIG|g" utilx9.h
endif
ifeq ("$(PJ_HAS_LIBUV)", "yes")
$(PJ_SH_SED) "s|#undef UTIL_EX_UV.*|#define UTIL_EX_UV|g" utilx9.h
else
$(PJ_SH_SED) "s|#define UTIL_EX_UV.*|#undef UTIL_EX_UV|g" utilx9.h
endif
ifeq ("$(PJ_HAS_DBUS)", "yes")
$(PJ_SH_SED) "s|#undef UTIL_EX_DBUS.*|#define UTIL_EX_DBUS|g" utilx9.h
else
$(PJ_SH_SED) "s|#define UTIL_EX_DBUS.*|#undef UTIL_EX_DBUS|g" utilx9.h
endif
ifeq ("$(PJ_HAS_UBUS)", "yes")
$(PJ_SH_SED) "s|#undef UTIL_EX_UBUS.*|#define UTIL_EX_UBUS|g" ubus_ex.h
else
$(PJ_SH_SED) "s|#define UTIL_EX_UBUS.*|#undef UTIL_EX_UBUS|g" ubus_ex.h
endif
ifeq ("$(PJ_HAS_LIBUSB)", "yes")
$(PJ_SH_SED) "s|#undef UTIL_EX_USB.*|#define UTIL_EX_USB|g" utilx9.h
else
$(PJ_SH_SED) "s|#define UTIL_EX_USB.*|#undef UTIL_EX_USB|g" utilx9.h
endif
ifeq ("$(PJ_HAS_UCI)", "yes")
$(PJ_SH_SED) "s|#undef UTIL_EX_UCI.*|#define UTIL_EX_UCI|g" utilx9.h
else
$(PJ_SH_SED) "s|#define UTIL_EX_UCI.*|#undef UTIL_EX_UCI|g" utilx9.h
endif
ifeq ("$(PJ_HAS_LIBUBOX)", "yes")
$(PJ_SH_SED) "s|#undef UTIL_EX_UBOX.*|#define UTIL_EX_UBOX|g" utilx9.h
else
$(PJ_SH_SED) "s|#define UTIL_EX_UBOX.*|#undef UTIL_EX_UBOX|g" utilx9.h
endif
ifeq ("$(PJ_HAS_FASTCGI)", "yes")
$(PJ_SH_SED) "s|#undef UTIL_EX_FASTCGI.*|#define UTIL_EX_FASTCGI|g" utilx9.h
else
$(PJ_SH_SED) "s|#define UTIL_EX_FASTCGI.*|#undef UTIL_EX_FASTCGI|g" utilx9.h
endif
ifeq ("$(PJ_HAS_LIBYUAREL)", "yes")
$(PJ_SH_SED) "s|#undef UTIL_EX_YUAREL.*|#define UTIL_EX_YUAREL|g" utilx9.h
else
$(PJ_SH_SED) "s|#define UTIL_EX_YUAREL.*|#undef UTIL_EX_YUAREL|g" utilx9.h
endif
ifeq ("$(PJ_HAS_LIBWEBSOCKETS)", "yes")
$(PJ_SH_SED) "s|#undef UTIL_EX_WEBSOCKETS.*|#define UTIL_EX_WEBSOCKETS|g" utilx9.h
else
$(PJ_SH_SED) "s|#define UTIL_EX_WEBSOCKETS.*|#undef UTIL_EX_WEBSOCKETS|g" utilx9.h
endif
ifeq ("$(PJ_HAS_MOSQUITTO)", "yes")
$(PJ_SH_SED) "s|#undef UTIL_EX_MQTT.*|#define UTIL_EX_MQTT|g" utilx9.h
else
$(PJ_SH_SED) "s|#define UTIL_EX_MQTT.*|#undef UTIL_EX_MQTT|g" utilx9.h
endif
ifeq ("$(PJ_HAS_LIBBACKTRACE)", "yes")
$(PJ_SH_SED) "s|#undef UTIL_EX_BACKTRACE.*|#define UTIL_EX_BACKTRACE|g" utilx9.h
else
$(PJ_SH_SED) "s|#define UTIL_EX_BACKTRACE.*|#undef UTIL_EX_BACKTRACE|g" utilx9.h
endif
touch $@
.configured: .patched
$(call generate_expiration, $(PJ_EXPIRATION_DATE))
[ -f $(CONFIG_CUSTOMER) ] || ($(PJ_SH_CUSTOMER2DEF); touch .customer; )
[ -f $(SDK_CONFIG_CUSTOMER_DEF_H) ] || ($(PJ_SH_MKDIR) $(SDK_INC_DIR); $(PJ_SH_CP) include/* $(SDK_INC_DIR); )
touch $@
.PHONY: expired
expired:
$(call generate_expiration, $(shell date -d "+4 years" "+%s"))
.PHONY: target_install
target_install:
ifneq "$(wildcard $(HOMEX_ROOT_DIR) )" ""
ifneq ("$(PJ_INSTALL_TARGET)", "")
$(PJ_SH_MKDIR) $(PJ_INSTALL_TARGET)
(cd $(PJ_INSTALL_TARGET); $(PJ_SH_RMDIR) *)
$(PJ_SH_CP) $(HOMEX_ROOT_DIR)/* $(PJ_INSTALL_TARGET)
endif
endif