fiss-minit

A standalone service supervisor based on minit
Log | Files | Refs | README | LICENSE

Makefile (1907B)


      1 all: minit msvc pidfilehack minit-update
      2 
      3 #CFLAGS=-pipe -march=i386 -fomit-frame-pointer -Os -I../dietlibc/include
      4 CC=gcc
      5 PIE=
      6 CFLAGS=-pipe -fomit-frame-pointer -Os $(PIE) -Wextra -Wall
      7 CROSS=
      8 #CROSS=arm-linux-
      9 LDFLAGS=-s $(PIE)
     10 MANDIR=/usr/man
     11 
     12 ifneq ($(DEBUG),)
     13 CFLAGS+=-g
     14 LDFLAGS+=-g
     15 else
     16 CFLAGS+=-O2 -fomit-frame-pointer
     17 LDFLAGS+=-s
     18 endif
     19 
     20 ifneq ($(MINITROOT),)
     21 CFLAGS+="-DMINITROOT=\"$(MINITROOT)\""
     22 else
     23 MINITROOT=/etc/minit
     24 endif
     25 
     26 minit: minit.o split.o openreadclose.o opendevconsole.o
     27 msvc: msvc.o
     28 minit-update: minit-update.o
     29 pidfilehack: pidfilehack.o
     30 
     31 %.o: %.c
     32 	$(CROSS)$(CC) $(CFLAGS) -c $<
     33 
     34 %: %.o 
     35 	$(CROSS)$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) 
     36 
     37 compile_flags.txt:
     38 	echo $(CFLAGS) | tr ' ' '\n' > compile_flags.txt
     39 
     40 clean:
     41 	rm -f *.o minit msvc pidfilehack minit-update
     42 
     43 install-files:
     44 	install -d $(DESTDIR)$(MINITROOT) $(DESTDIR)/sbin $(DESTDIR)/bin $(DESTDIR)$(MANDIR)/man8 $(DESTDIR)$(MANDIR)/man1
     45 	install minit pidfilehack $(DESTDIR)/sbin
     46 	install write_proc hard-reboot minit-update $(DESTDIR)/sbin
     47 	install msvc serdo ftrigger waitinterface waitport $(DESTDIR)/bin
     48 	if test -f $(DESTDIR)/sbin/shutdown; then install shutdown $(DESTDIR)/sbin/mshutdown; else install shutdown $(DESTDIR)/sbin/shutdown; fi
     49 	test -f $(DESTDIR)/sbin/init || ln $(DESTDIR)/sbin/minit $(DESTDIR)/sbin/init
     50 	install -m 644 hard-reboot.8 minit-list.8 minit-shutdown.8 minit-update.8 minit.8 msvc.8 pidfilehack.8 serdo.8 $(DESTDIR)$(MANDIR)/man8
     51 	install -m 644 waitinterface.1 waitport.1 ftrigger.1 $(DESTDIR)$(MANDIR)/man1
     52 
     53 install-fifos:
     54 	-mkfifo -m 600 $(DESTDIR)$(MINITROOT)/in $(DESTDIR)$(MINITROOT)/out
     55 
     56 install: install-files install-fifos
     57 
     58 VERSION=minit-$(shell head -n 1 CHANGES|sed 's/://')
     59 CURNAME=$(notdir $(shell pwd))
     60 
     61 tar: clean rename
     62 	cd ..; tar cvvf $(VERSION).tar.bz2 --use=bzip2 --exclude CVS $(VERSION)
     63 
     64 rename:
     65 	if test $(CURNAME) != $(VERSION); then cd .. && mv $(CURNAME) $(VERSION); fi