mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +07:00
Cleanup device creation and initial mount by assuming that the kernel has devtmpfs enabled. This is the default for most modern GNU/Linux distributions. See http://lwn.net/Articles/331818/ for more info. Also, since finit is targeted at deeply embedded systems hooks for the BusyBox udev replacement, mdev has been added. If MDEV is defined in the build it will take care of both hotplugging of devices and initial setup of /dev Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
87 lines
2.9 KiB
Makefile
87 lines
2.9 KiB
Makefile
# finit - The Improved fast init
|
|
#
|
|
# Copyright (c) 2008 Claudio Matsuoka
|
|
#
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
# of this software and associated documentation files (the "Software"), to deal
|
|
# in the Software without restriction, including without limitation the rights
|
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
# copies of the Software, and to permit persons to whom the Software is
|
|
# furnished to do so, subject to the following conditions:
|
|
#
|
|
# The above copyright notice and this permission notice shall be included in
|
|
# all copies or substantial portions of the Software.
|
|
#
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
# THE SOFTWARE.
|
|
|
|
.PHONY: all romfs clean
|
|
|
|
# Top directory for building complete system, fall back to this directory
|
|
ROOTDIR ?= $(shell pwd)
|
|
|
|
VERSION = 1.0-pre
|
|
PKG = finit-$(VERSION)
|
|
EXEC = finit
|
|
OBJS = finit.o helpers.o initctl.o signal.o
|
|
SRCS = $(OBJS:.o=.c)
|
|
DEPS = $(addprefix .,$(SRCS:.c=.d))
|
|
CFLAGS += -W -Wall -Werror -Os
|
|
# Disable annoying gcc warning for "warn_unused_result", see GIT 37af997
|
|
CPPFLAGS += -U_FORTIFY_SOURCE
|
|
CPPFLAGS += -I$(ROOTDIR)/$(CONFIG_LINUXDIR)/include/
|
|
# Build for embedded systems, not notebook by default, see finit.h
|
|
CPPFLAGS += -DEMBEDDED_SYSTEM -DBUILTIN_RUNPARTS
|
|
CPPFLAGS += -DVERSION=\"$(VERSION)\" -DWHOAMI=\"`whoami`@`hostname`\"
|
|
CPPFLAGS += -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_GNU_SOURCE
|
|
|
|
prefix ?= /usr/local
|
|
sysconfdir ?= /etc
|
|
datadir = $(prefix)/share/doc/finit
|
|
mandir = $(prefix)/share/man/man8
|
|
|
|
include common.mk
|
|
|
|
all: Makefile $(EXEC)
|
|
|
|
$(OBJS): Makefile
|
|
|
|
finit: $(OBJS)
|
|
|
|
# @ln -sf /sbin/finit /sbin/init
|
|
install: all
|
|
@install -d $(DESTDIR)$(prefix)/sbin
|
|
@install -d $(DESTDIR)$(sysconfdir)
|
|
@install -d $(DESTDIR)$(datadir)
|
|
@install -d $(DESTDIR)$(mandir)
|
|
@for file in $(EXEC); do \
|
|
printf " INSTALL $(DESTDIR)$(prefix)/sbin/$$file\n"; \
|
|
install -m 0755 $$file $(DESTDIR)$(prefix)/sbin/$$file; \
|
|
done
|
|
|
|
uninstall:
|
|
-@for file in $(EXEC); do \
|
|
printf " REMOVE $(DESTDIR)$(prefix)/sbin/$$file\n"; \
|
|
$(RM) $(DESTDIR)$(prefix)/sbin/$$file; \
|
|
done
|
|
|
|
clean:
|
|
-@$(RM) $(OBJS) $(DEPS) $(EXEC)
|
|
|
|
distclean: clean
|
|
-@$(RM) $(JUNK) unittest *.o
|
|
|
|
# Include automatically generated rules, such as:
|
|
# uncgi.o: .../some/dir/uncgi.c /usr/include/stdio.h
|
|
# but don't bother during clean!
|
|
ifneq ($(MAKECMDGOALS),clean)
|
|
ifneq ($(MAKECMDGOALS),distclean)
|
|
-include $(DEPS)
|
|
endif
|
|
endif
|