1e5b75505Sopenharmony_ciifeq ($(KERNEL_TYPE), linux)
2e5b75505Sopenharmony_ciCC = arm-himix410-linux-gcc
3e5b75505Sopenharmony_ciAR = arm-himix410-linux-ar
4e5b75505Sopenharmony_ciLD=arm-himix410-linux-ld
5e5b75505Sopenharmony_ciCFLAGS  := -MMD -O2 -g -w -fsigned-char
6e5b75505Sopenharmony_cielse
7e5b75505Sopenharmony_ciCC = ../../../../prebuilts/gcc/linux-x86/arm/arm-linux-ohoseabi-gcc/bin/arm-linux-ohoseabi-gcc
8e5b75505Sopenharmony_ciAR = ../../../../prebuilts/gcc/linux-x86/arm/arm-linux-ohoseabi-gcc/bin/arm-linux-ohoseabi-ar
9e5b75505Sopenharmony_ciCFLAGS  := -flto -MMD -O2 -g -w -fsigned-char
10e5b75505Sopenharmony_ciendif
11e5b75505Sopenharmony_ci
12e5b75505Sopenharmony_ciifeq ($(COMPILER_TYPE), clang)
13e5b75505Sopenharmony_ciSYSROOT_PATH ?= ../../../../sysroot
14e5b75505Sopenharmony_ciARCH_CFLAGS ?= --target=arm-liteos-ohos -march=armv7-a -mfloat-abi=softfp
15e5b75505Sopenharmony_ciCC := $(COMPILER_DIR)/bin/clang
16e5b75505Sopenharmony_ciAR := $(COMPILER_DIR)/bin/llvm-ar
17e5b75505Sopenharmony_ciCFLAGS += --sysroot=$(SYSROOT_PATH) $(ARCH_CFLAGS)
18e5b75505Sopenharmony_ciCFLAGS += -I$(abspath ../../../../drivers/peripheral/wlan/client/include)
19e5b75505Sopenharmony_ciLDFLAGS += --sysroot=$(SYSROOT_PATH) $(ARCH_CFLAGS)
20e5b75505Sopenharmony_ciLDFLAGS += -lc
21e5b75505Sopenharmony_ciLDFLAGS += -v
22e5b75505Sopenharmony_ciendif
23e5b75505Sopenharmony_ci
24e5b75505Sopenharmony_ci#TEST_AP = testap
25e5b75505Sopenharmony_ci#TEST_WPA = testwpa
26e5b75505Sopenharmony_ci
27e5b75505Sopenharmony_ciWPA_LDFLAGS = -L$(DEPDIR) -lsec_shared -lrt -lm -lpthread -lhilog_shared -lwifi_driver_client
28e5b75505Sopenharmony_ciTEST_LDFLAGS = -L./ -lwpa -L$(DEPDIR) -lsec_shared -lrt -lm -lpthread -lhilog_shared -lwifi_driver_client
29e5b75505Sopenharmony_ci
30e5b75505Sopenharmony_ciWPA_SHARED = libwpa.so
31e5b75505Sopenharmony_ciWPA_STATIC = libwpa.a
32e5b75505Sopenharmony_ci#OBJS_WPA = test_wpa.o
33e5b75505Sopenharmony_ci#OBJS_AP = test_hostapd.o
34e5b75505Sopenharmony_ci
35e5b75505Sopenharmony_ciCDEPS = $(patsubst %.c,%.d,test_wpa.c test_hostapd.c)
36e5b75505Sopenharmony_ci
37e5b75505Sopenharmony_ciifeq ($(LIB_TYPE), 1)
38e5b75505Sopenharmony_ciall : $(WPA_SHARED)
39e5b75505Sopenharmony_cielse
40e5b75505Sopenharmony_ciall : $(WPA_STATIC)
41e5b75505Sopenharmony_ciendif
42e5b75505Sopenharmony_ci
43e5b75505Sopenharmony_ci%.o : %.c
44e5b75505Sopenharmony_ci	$(CC) $(CFLAGS) -c $< -o $@
45e5b75505Sopenharmony_ci
46e5b75505Sopenharmony_ci$(WPA_SHARED) :
47e5b75505Sopenharmony_ciifeq ($(KERNEL_TYPE), linux)
48e5b75505Sopenharmony_ci	$(CC)  -O2  -shared -fPIC -Wl,-z,defs objs/*.o -o $@ $(WPA_LDFLAGS) $(LDFLAGS)
49e5b75505Sopenharmony_cielse
50e5b75505Sopenharmony_ci	$(CC)  -flto -O2  -shared -fPIC -Wl,-z,defs objs/*.o -o $@ $(WPA_LDFLAGS) $(LDFLAGS)
51e5b75505Sopenharmony_ciendif
52e5b75505Sopenharmony_ci
53e5b75505Sopenharmony_ci$(WPA_STATIC) :
54e5b75505Sopenharmony_ci	$(AR) -crs $@ objs/*.o
55e5b75505Sopenharmony_ci
56e5b75505Sopenharmony_ci$(TEST_WPA) : $(OBJS_WPA)
57e5b75505Sopenharmony_ci	$(CC) -o $@ $< $(TEST_LDFLAGS) $(LDFLAGS)
58e5b75505Sopenharmony_ci	rm -f $(CDEPS)
59e5b75505Sopenharmony_ci
60e5b75505Sopenharmony_ci$(TEST_AP) : $(OBJS_AP)
61e5b75505Sopenharmony_ci	$(CC) -o $@ $< $(TEST_LDFLAGS) $(LDFLAGS)
62e5b75505Sopenharmony_ci	rm -f $(CDEPS)
63e5b75505Sopenharmony_ci
64e5b75505Sopenharmony_ci
65e5b75505Sopenharmony_ciclean:
66e5b75505Sopenharmony_ci	rm -f $(WPA_SHARED)
67e5b75505Sopenharmony_ci	rm -f $(WPA_STATIC)
68e5b75505Sopenharmony_ci	rm -f $(OBJS_AP)
69e5b75505Sopenharmony_ci	rm -f $(TEST_AP)
70e5b75505Sopenharmony_ci	rm -f $(OBJS_WPA)
71e5b75505Sopenharmony_ci	rm -f $(TEST_WPA)
72e5b75505Sopenharmony_ci	rm -f $(CDEPS)
73