-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
102 lines (86 loc) · 3.08 KB
/
Makefile
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
# Makefile for coLinux
# User config, if exist. Empty, if not.
USER_CFG := $(shell test -f bin/user-build.cfg \
&& echo "bin/user-build.cfg" )
ifneq ($(USER_CFG),)
# Detect target host OS (only if not as argument on make)
HOSTOS := $(shell . $(USER_CFG); echo $$COLINUX_HOST_OS)
# Target directories
export COLINUX_TARGET_KERNEL_SOURCE := \
$(shell . bin/build-common.sh --get-vars; \
echo $$COLINUX_TARGET_KERNEL_SOURCE)
export COLINUX_TARGET_KERNEL_BUILD := \
$(shell . bin/build-common.sh --get-vars; \
echo $$COLINUX_TARGET_KERNEL_BUILD)
export COLINUX_TARGET_KERNEL_PATH := \
$(shell . bin/build-common.sh --get-vars; \
echo $$COLINUX_TARGET_KERNEL_PATH)
export COLINUX_ENABLE_WX := \
$(shell . bin/build-common.sh --get-vars; \
echo $$COLINUX_ENABLE_WX)
else
X := $(shell echo "bin/user-build.cfg: Missing configured file." 1>&2 )
conf_missing:
@echo "Build is not configured"
@exit 1
endif
.PHONY: colinux kernel clean distclean help
# Include host OS specific makefile
ifneq ($(HOSTOS),)
include Makefile.$(HOSTOS)
# Compile daemons
colinux:
@cd src && make colinux
kernel:
@cd bin && ./build-kernel.sh
# Dump python build tree
dump:
@cd src && python ../bin/make.py colinux --dump
endif
clean:
make -C src clean
find src \( -name '.tmp_versions' \
-o -name '.module.*_build' \
\) -type d -print | xargs rm -rf
find src bin \( -name '*.o' -o -name '*.pyc' \
-o -name '.*.cmd' -o -name 'colinux.mod.c' \
-o -name 'Module*.symvers' \
\) -type f -print | xargs rm -f
distclean: clean
ifneq ($(USER_CFG),)
rm -f bin/user-build.cfg bin/user-build.cfg.old \
$(shell . $(USER_CFG); echo $$BUILD_DIR)/.build-*.md5
endif
find src \( -name 'premaid' \
\) -type d -print | xargs rm -rf
find src \( -name '*.orig' -o -name '*.rej' \
-o -name '.*.orig' -o -name '.*.rej' \
-o -name '*%' \
\) -type f -print | xargs rm -f
help:
@echo ''
@echo 'Execute "make" or "make all" to build all targets'
@echo ''
@echo 'Other generic targets:'
@echo ' all - Build crosstools, all targets marked with [*]'
@echo '* download - Download all sources (for cross tools and libs)'
@echo '* cross - Build and install cross compiler and binutils'
@echo '* libs - Build and install libs: fltk,win32api'
@echo '* kernel - Build colinux kernel vmlinux and modules'
@echo '* colinux - Build colinux daemons'
@echo ' package - Create ZIP file packages for pre releases'
@echo ' installer - Create Installer (need wine and running x11)'
@echo ' dump - Dump build tree and dependencies from python scripts'
@echo ''
@echo 'Cleaning colinux build (daemons only, no cross compiler, no libs):'
@echo ' clean - remove most generated files but keep distry files'
@echo ' distclean - remove all generated files + config + md5sum'
@echo ''
@echo 'Options'
@echo ' HOSTOS=winnt - Build targets for Winnt'
@echo ' HOSTOS=linux - Build targets for Linux as host'
ifeq ($(USER_CFG),)
@echo ''
@echo 'Please configure directories in file bin/user-build.cfg and use'
@echo 'bin/sample.user-build.cfg as sample! Or use "./configure --help"'
endif