Changeset 474


Ignore:
Timestamp:
Feb 27, 2011, 1:36:52 AM (10 years ago)
Author:
khorben
Message:

Using the UNIX "others" utilities from DeforaOS

Location:
trunk/Apps/Unix/Sources/others
Files:
3 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Apps/Unix/Sources/others/Makefile

    r152 r474  
    11PACKAGE = others
    2 VERSION = 0.0.0
    3 SUBDIRS = src
     2VERSION = 0.0.1
     3DESTDIR =
     4PREFIX  = /usr/local
     5TARGETS = $(PACKAGE)-$(VERSION)/src/sh
     6HOST    = `uname -m | tr A-Z a-z`--`uname -s | tr A-Z a-z`
     7CPPFLAGS= -nostdinc -I$(DESTDIR)$(PREFIX)/include
     8CFLAGS  = -ffreestanding
     9LDFLAGS = -nostdlib -L$(DESTDIR)$(PREFIX)/lib -Wl,-rpath-link,$(DESTDIR)$(PREFIX)/lib -Wl,$(DESTDIR)$(PREFIX)/lib/start.o -lc
     10FETCH   = wget --continue
    411RM      = rm -f
    5 LN      = ln -sf
    6 TAR     = tar -czvf
     12TAR     = tar
     13TOUCH   = touch
     14ARCHIVE = $(PACKAGE)-$(VERSION).tar.gz
     15MIRROR  = http://www.defora.org/os/download/download/3483
     16URL     = $(MIRROR)/$(ARCHIVE)
    717
     18all: $(TARGETS)
    819
    9 all: subdirs
     20build: $(PACKAGE)-$(VERSION)/.build-done
    1021
    11 subdirs:
    12         @for i in $(SUBDIRS); do (cd $$i && $(MAKE)) || exit; done
     22download: .download-done
     23
     24extract: $(PACKAGE)-$(VERSION)/.extract-done
     25
     26install: $(TARGETS)
     27        (cd $(PACKAGE)-$(VERSION) && $(MAKE) $@)
     28
     29patch: $(PACKAGE)-$(VERSION)/.patch-done
     30
     31uninstall:
     32        (cd $(PACKAGE)-$(VERSION) && $(MAKE) $@)
    1333
    1434clean:
    15         @for i in $(SUBDIRS); do (cd $$i && $(MAKE) clean) || exit; done
     35        if [ -f $(PACKAGE)-$(VERSION)/Makefile ]; then \
     36                (cd $(PACKAGE)-$(VERSION) && $(MAKE) $@); \
     37        fi
    1638
    1739distclean:
    18         @for i in $(SUBDIRS); do (cd $$i && $(MAKE) distclean) || exit; done
     40        $(RM) -r $(PACKAGE)-$(VERSION)
    1941
    20 dist:
    21         $(RM) -r $(PACKAGE)-$(VERSION)
    22         $(LN) . $(PACKAGE)-$(VERSION)
    23         @$(TAR) $(PACKAGE)-$(VERSION).tar.gz \
    24                 $(PACKAGE)-$(VERSION)/src/halt.c \
    25                 $(PACKAGE)-$(VERSION)/src/hexdump.c \
    26                 $(PACKAGE)-$(VERSION)/src/hostname.c \
    27                 $(PACKAGE)-$(VERSION)/src/login.c \
    28                 $(PACKAGE)-$(VERSION)/src/mktemp.c \
    29                 $(PACKAGE)-$(VERSION)/src/mount.c \
    30                 $(PACKAGE)-$(VERSION)/src/poweroff.c \
    31                 $(PACKAGE)-$(VERSION)/src/reboot.c \
    32                 $(PACKAGE)-$(VERSION)/src/tar.c \
    33                 $(PACKAGE)-$(VERSION)/src/umount.c \
    34                 $(PACKAGE)-$(VERSION)/src/uptime.c \
    35                 $(PACKAGE)-$(VERSION)/src/w.c \
    36                 $(PACKAGE)-$(VERSION)/src/Makefile \
    37                 $(PACKAGE)-$(VERSION)/src/tar.h \
    38                 $(PACKAGE)-$(VERSION)/src/utmpx.c \
    39                 $(PACKAGE)-$(VERSION)/src/project.conf \
    40                 $(PACKAGE)-$(VERSION)/Makefile \
    41                 $(PACKAGE)-$(VERSION)/COPYING \
    42                 $(PACKAGE)-$(VERSION)/project.conf
    43         $(RM) $(PACKAGE)-$(VERSION)
     42$(PACKAGE)-$(VERSION)/.extract-done: $(ARCHIVE)
     43        $(TAR) -xzvf $(ARCHIVE)
     44        $(TOUCH) $@
    4445
    45 install: all
    46         @for i in $(SUBDIRS); do (cd $$i && $(MAKE) install) || exit; done
     46$(PACKAGE)-$(VERSION)/.patch-done: $(PACKAGE)-$(VERSION)/.extract-done
     47        for i in patches/*; do \
     48                [ -f "$$i" ] && (cd $(PACKAGE)-$(VERSION) && patch -p1) \
     49                                < "$$i"; \
     50        done; \
     51        $(TOUCH) $@
    4752
    48 uninstall:
    49         @for i in $(SUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit; done
     53$(PACKAGE)-$(VERSION)/.build-done: $(PACKAGE)-$(VERSION)/.patch-done
     54        (cd $(PACKAGE)-$(VERSION) && $(MAKE) CPPFLAGS="$(CPPFLAGS)" \
     55                        CFLAGS="$(CFLAGS)" \
     56                        LDFLAGS="$(LDFLAGS)")
     57        $(TOUCH) $@
    5058
    51 .PHONY: all subdirs clean distclean dist install uninstall
     59$(ARCHIVE):
     60        $(FETCH) $(URL)
     61
     62$(PACKAGE)-$(VERSION)/src/sh: $(PACKAGE)-$(VERSION)/.build-done
     63
     64.PHONY: all build clean distclean download extract install patch uninstall
Note: See TracChangeset for help on using the changeset viewer.