-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
84 lines (62 loc) · 1.78 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
UELD_OS := unkown
UELD_VERSION := $(shell cat version)
ifeq "$(PLATFORM)" ""
PLATFORM := $(shell ./systype.sh)
endif
include Make.defines.$(PLATFORM)
PREFIX :=
INSTALLDIR := /lib/ueld/ueld-$(UELD_VERSION)
ETCDIR := $(PREFIX)/etc/ueld
OBJS := main.o minit.o fileio.o reboot.o tools.o respawn.o os/$(UELD_OS)/pw.o os/$(UELD_OS)/chvt.o os/$(UELD_OS)/ctrlaltdel.o os/$(UELD_OS)/proc.o os/$(UELD_OS)/mnt.o
CROSS :=
ifeq "$(CC)" ""
CC := gcc
endif
STRIP := strip
CFLAG := -Wall -O2 -std=c99 $(UELD_OS_CFLAGS)
all : ueld
ueld : $(OBJS)
@echo " LD $@"
@$(CROSS)$(CC) -o ueld $(OBJS)
@echo " STRIP $@"
@$(CROSS)$(STRIP) -s $@
%.o : %.c config.h
@echo " CC $@"
@$(CROSS)$(CC) -c -o $@ $(CFLAG) $<
config.h:
@echo "Please use ./mkconfig.sh to generate a config header."
@false
install_ueld_executable : ueld
mkdir -p $(PREFIX)$(INSTALLDIR)
rm -f $(PREFIX)$(INSTALLDIR)/ueld*
cp ueld $(PREFIX)$(INSTALLDIR)
ln -s -f $(INSTALLDIR)/ueld $(PREFIX)/sbin/init
cp usertool/ueldctl $(PREFIX)$(INSTALLDIR)/ueldctl
ln -s -f $(INSTALLDIR)/ueldctl $(PREFIX)/sbin/ueldctl
install_generic_etc_file:
mkdir -p $(ETCDIR)
cp -n etcfiles/generic-$(UELD_OS)/* $(ETCDIR)/
cp -n etcfiles/generic/* $(ETCDIR)/
touch $(ETCDIR)/*
chmod 755 $(ETCDIR)/*.sh
install_no_initramfs:
@$(MAKE) install_ueld_executable
mkdir -p $(ETCDIR)
cp -n etcfiles/no_initramfs/* $(ETCDIR)/
touch $(ETCDIR)/*
chmod 755 $(ETCDIR)/*.sh
@$(MAKE) install_generic_etc_file
install_sysv_compat:
@$(MAKE) install_ueld_executable
mkdir -p $(ETCDIR)
cp -n etcfiles/sysv_compat/* $(ETCDIR)/
touch $(ETCDIR)/*
chmod 755 $(ETCDIR)/*
@$(MAKE) install_generic_etc_file
install:
@$(MAKE) install_ueld_executable
@$(MAKE) install_generic_etc_file
test:
@echo "FIXME: Need a test target"
clean:
rm -f *.o os/$(UELD_OS)/*.o config.h ueld