Add README file
[wave300.git] / Makefile
blob763e0ad288c704ddbbfecb0ef12d4e7428c8f323
2 CONFIG_FILE:=.config
4 CONFIG_EXISTS := $(wildcard $(CONFIG_FILE))
6 VCPROJ_FNAME:=msvc_all_[$(shell echo $${PWD\#\#*/})].vcproj
7 VCXPROJ_FNAME:=msvc_all_[$(shell echo $${PWD\#\#*/})].vcxproj
8 VCXPROJ_FILTERS_FNAME:=$(VCXPROJ_FNAME).filters
9 WBLD_DIR:=support/wbld_scripts/
11 ifneq ($(CONFIG_EXISTS),)
13 ifneq ($(_LQBLD_FTP_COPY),)
14 AUTHFILE:=support/release/release_config/.nld_release_ftp
15 FTPDIR:=Israel/users/wave300/Kiev_MTLK/nld/temp/$(USER)
16 endif
18 include $(CONFIG_FILE)
20 all: .build_tree_ts
21 @make -C builds/$(CONFIG_ENVIRONMENT_NAME) install
22 ifneq ($(_TFTPROOT),)
23 ifeq ($(CONFIG_LIN_DRV), y)
24 @cp -v builds/$(CONFIG_ENVIRONMENT_NAME)/binaries/wls/driver/* $(_TFTPROOT)
25 endif
26 ifeq ($(CONFIG_LIN_MTTOOLS), y)
27 @cp -v builds/$(CONFIG_ENVIRONMENT_NAME)/binaries/wls/mttools/* $(_TFTPROOT)
28 endif
29 ifeq ($(CONFIG_LIN_RTLOG_COMPONENTS), y)
30 @cp -v builds/$(CONFIG_ENVIRONMENT_NAME)/binaries/wls/rtlogger/* $(_TFTPROOT)
31 endif
32 ifeq ($(CONFIG_LIN_DUT), y)
33 @cp -v builds/$(CONFIG_ENVIRONMENT_NAME)/binaries/dut/* $(_TFTPROOT)
34 endif
35 endif
36 ifneq ($(_LQBLD_FTP_COPY),)
37 ifeq ($(CONFIG_LIN_DRV), y)
38 @ncftpput -m -v -R -f $(AUTHFILE) $(FTPDIR) builds/$(CONFIG_ENVIRONMENT_NAME)/binaries/wls/driver/*
39 endif
40 ifeq ($(CONFIG_LIN_MTTOOLS), y)
41 @ncftpput -m -v -R -f $(AUTHFILE) $(FTPDIR) builds/$(CONFIG_ENVIRONMENT_NAME)/binaries/wls/mttools/*
42 endif
43 ifeq ($(CONFIG_LIN_RTLOG_COMPONENTS), y)
44 @ncftpput -m -v -R -f $(AUTHFILE) $(FTPDIR) builds/$(CONFIG_ENVIRONMENT_NAME)/binaries/wls/rtlogger/*
45 endif
46 ifeq ($(CONFIG_LIN_DUT), y)
47 @ncftpput -m -v -R -f $(AUTHFILE) $(FTPDIR) builds/$(CONFIG_ENVIRONMENT_NAME)/binaries/dut/*
48 endif
49 endif
51 else
53 all:
54 @echo ERROR: no .config file found!
55 @echo Run "make xconfig" or "make menuconfig" first to generate .config file!
57 clean:
58 @echo ERROR: no .config file found!
59 @echo Run "make xconfig" or "make menuconfig" first to generate .config file!
61 endif
63 vcproj:
64 @echo "Building VCPROJ ($(VCPROJ_FNAME))..."
65 @perl $(WBLD_DIR)/mtlk_list_files.pl . mtlk_list_files.cfg $(WBLD_DIR)/msvc_all.vcproj.cfg.template NO_FILTERS > $(VCPROJ_FNAME) < $(WBLD_DIR)/msvc_all.vcproj.template
66 @echo "Done ($(VCPROJ_FNAME))!"
68 vcxproj:
69 @echo "Building VCXPROJ ($(VCXPROJ_FNAME))..."
70 @perl $(WBLD_DIR)/mtlk_list_files.pl . mtlk_list_files.cfg $(WBLD_DIR)/msvc_all.vcxproj.cfg.template $(WBLD_DIR)/msvc_all.vcxproj.cfg_list.template > $(VCXPROJ_FNAME) < $(WBLD_DIR)/msvc_all.vcxproj.template
71 @perl $(WBLD_DIR)/mtlk_list_files.pl . mtlk_list_files.cfg $(WBLD_DIR)/msvc_all.vcxproj.cfg.template $(WBLD_DIR)/msvc_all.vcxproj.cfg_list.template > $(VCXPROJ_FILTERS_FNAME) < $(WBLD_DIR)/msvc_all.vcxproj.filters.template
72 @echo "Done ($(VCXPROJ_FNAME))!"
74 .PHONY: .build_conf .build_mconf .build_nconf .build_qconf .config_x .config_m .config_c .config_d config xconfig menuconfig nconfig defconfig
76 configure: configure.ac branch_version.m4
77 autoreconf --install
79 branch_version.m4: branch_version.m4.in mtlk_version
80 @echo dnl WARNING: > $@
81 @echo dnl WARNING: This file is automatically generated from branch_version.m4.in. >> $@
82 @echo dnl WARNING: Do not edit it, all changes will gone. >> $@
83 @echo dnl WARNING: Edit branch_version.m4.in instead. >> $@
84 @echo dnl WARNING: >> $@
85 @echo >> $@
86 @sed -e"s/@BRANCH_VERSION@/`perl ./support/mtlk_ver.pl -G < mtlk_version`/g" < branch_version.m4.in >> $@
88 config: .build_conf .config_c .config.h
89 xconfig: .build_qconf .config_x .config.h
90 menuconfig: .build_mconf .config_m .config.h
91 nconfig: .build_nconf .config_n .config.h
92 defconfig: .build_conf .config_d .config.h
94 BUILD_TREE_DEPS:=$(shell [ -f .config ] && ./support/cfghlpr.sh .config get_bld_tree_cfg)
96 # NOTE: .config.h is being copied for MSVC oldconfig correct parsing
97 .build_tree_ts .config.h:: configure .config $(BUILD_TREE_DEPS)
98 ./support/cfghlpr.sh .config
99 @cp -v $(shell ./support/cfghlpr.sh .config get_bld_dir)/.config.h .
100 @touch .build_tree_ts
102 .build_conf:
103 @make -C tools/kconfig config
105 .build_qconf:
106 @make -C tools/kconfig xconfig
108 .build_mconf:
109 @make -C tools/kconfig menuconfig
111 .build_nconf:
112 @make -C tools/kconfig nconfig
114 ifneq ( $(BUILD_TREE_DEPS), )
116 $(BUILD_TREE_DEPS):
117 @echo -n
119 endif
121 .config_c:
122 ./tools/kconfig/conf ./MTLKConfig
123 test .config.h -nt .config || rm -f .config.h
125 .config_x:
126 ./tools/kconfig/qconf ./MTLKConfig
127 test .config.h -nt .config || rm -f .config.h
129 .config_m:
130 ./tools/kconfig/mconf ./MTLKConfig
131 test .config.h -nt .config || rm -f .config.h
133 .config_n:
134 ./tools/kconfig/nconf ./MTLKConfig
135 test .config.h -nt .config || rm -f .config.h
137 ifeq ($(MINICONFIG),)
138 MINICONFIG:=/dev/null
139 endif
141 .config_d:
142 ./tools/kconfig/conf -D $(MINICONFIG) MTLKConfig
143 test .config.h -nt .config || rm -f .config.h
146 @make -C builds/$(CONFIG_ENVIRONMENT_NAME) $@