Update build system, documentation and delete temp files
[wave300.git] / Makefile
blobf9dd0f97320242a4adfd77d6ca65880dd6dd29a2
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 distclean:
64 -rm -rf .build_tree_ts .config .config.h Makefile.in config.guess config.h.in config.sub configure depcomp install-sh missing compile branch_version.m4 builds autom4te.cache
65 @make -C tools/kconfig clean
67 vcproj:
68 @echo "Building VCPROJ ($(VCPROJ_FNAME))..."
69 @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
70 @echo "Done ($(VCPROJ_FNAME))!"
72 vcxproj:
73 @echo "Building VCXPROJ ($(VCXPROJ_FNAME))..."
74 @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
75 @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
76 @echo "Done ($(VCXPROJ_FNAME))!"
78 .PHONY: .build_conf .build_mconf .build_nconf .build_qconf .config_x .config_m .config_c .config_d config xconfig menuconfig nconfig defconfig
80 configure: configure.ac branch_version.m4
81 autoreconf --install
83 branch_version.m4: branch_version.m4.in mtlk_version
84 @echo dnl WARNING: > $@
85 @echo dnl WARNING: This file is automatically generated from branch_version.m4.in. >> $@
86 @echo dnl WARNING: Do not edit it, all changes will gone. >> $@
87 @echo dnl WARNING: Edit branch_version.m4.in instead. >> $@
88 @echo dnl WARNING: >> $@
89 @echo >> $@
90 @sed -e"s/@BRANCH_VERSION@/`perl ./support/mtlk_ver.pl -G < mtlk_version`/g" < branch_version.m4.in >> $@
92 config: .build_conf .config_c .config.h
93 xconfig: .build_qconf .config_x .config.h
94 menuconfig: .build_mconf .config_m .config.h
95 nconfig: .build_nconf .config_n .config.h
96 defconfig: .build_conf .config_d .config.h
98 BUILD_TREE_DEPS:=$(shell [ -f .config ] && ./support/cfghlpr.sh .config get_bld_tree_cfg)
100 # NOTE: .config.h is being copied for MSVC oldconfig correct parsing
101 .build_tree_ts .config.h:: configure .config $(BUILD_TREE_DEPS)
102 ./support/cfghlpr.sh .config
103 @cp -v $(shell ./support/cfghlpr.sh .config get_bld_dir)/.config.h .
104 @touch .build_tree_ts
106 .build_conf:
107 @make -C tools/kconfig config
109 .build_qconf:
110 @make -C tools/kconfig xconfig
112 .build_mconf:
113 @make -C tools/kconfig menuconfig
115 .build_nconf:
116 @make -C tools/kconfig nconfig
118 ifneq ( $(BUILD_TREE_DEPS), )
120 $(BUILD_TREE_DEPS):
121 @echo -n
123 endif
125 .config_c:
126 ./tools/kconfig/conf ./MTLKConfig
127 test .config.h -nt .config || rm -f .config.h
129 .config_x:
130 ./tools/kconfig/qconf ./MTLKConfig
131 test .config.h -nt .config || rm -f .config.h
133 .config_m:
134 ./tools/kconfig/mconf ./MTLKConfig
135 test .config.h -nt .config || rm -f .config.h
137 .config_n:
138 ./tools/kconfig/nconf ./MTLKConfig
139 test .config.h -nt .config || rm -f .config.h
141 ifeq ($(MINICONFIG),)
142 MINICONFIG:=/dev/null
143 endif
145 .config_d:
146 ./tools/kconfig/conf -D $(MINICONFIG) MTLKConfig
147 test .config.h -nt .config || rm -f .config.h
150 @make -C builds/$(CONFIG_ENVIRONMENT_NAME) $@