morpheus-base

morpheus base system
git clone git://git.2f30.org/morpheus-base
Log | Files | Refs

Makefile (791B)


      1 include config.mk
      2 
      3 OBJ = sinit.o
      4 BIN = sinit
      5 
      6 all: $(BIN)
      7 
      8 $(BIN): $(OBJ)
      9 	$(CC) $(LDFLAGS) -o $@ $(OBJ) $(LDLIBS)
     10 
     11 sinit.o: config.h
     12 
     13 install: all
     14 	mkdir -p $(DESTDIR)$(PREFIX)/bin
     15 	cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
     16 	mkdir -p $(DESTDIR)$(MANPREFIX)/man8
     17 	sed "s/VERSION/$(VERSION)/g" < $(BIN).8 > $(DESTDIR)$(MANPREFIX)/man8/$(BIN).8
     18 
     19 uninstall:
     20 	rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
     21 	rm -f $(DESTDIR)$(MANPREFIX)/man8/$(BIN).8
     22 
     23 dist: clean
     24 	mkdir -p sinit-$(VERSION)
     25 	cp LICENSE Makefile README config.def.h config.mk sinit.8 sinit.c sinit-$(VERSION)
     26 	tar -cf sinit-$(VERSION).tar sinit-$(VERSION)
     27 	gzip sinit-$(VERSION).tar
     28 	rm -rf sinit-$(VERSION)
     29 
     30 clean:
     31 	rm -f $(BIN) $(OBJ) sinit-$(VERSION).tar.gz
     32 
     33 .SUFFIXES: .def.h
     34 
     35 .def.h.h:
     36 	cp $< $@
     37 
     38 .PHONY:
     39 	all install uninstall dist clean