source: trunk/System/Sources/libc/Makefile @ 441

Last change on this file since 441 was 441, checked in by khorben, 11 years ago

Storing temporary files within the extracted sources when possible

File size: 1.3 KB
Line 
1PACKAGE = libc
2VERSION = 0.0.3
3DESTDIR =
4PREFIX  = /usr/local
5TARGETS = $(PACKAGE)-$(VERSION)/src/libc.so
6HOST    = `uname -m | tr A-Z a-z`--`uname -s | tr A-Z a-z`
7FETCH   = wget
8RM      = rm -f
9TAR     = tar
10TOUCH   = touch
11ARCHIVE = $(PACKAGE)-$(VERSION).tar.gz
12MIRROR  = http://www.defora.org/os/download/download/3296
13URL     = $(MIRROR)/$(ARCHIVE)
14
15all: $(TARGETS)
16
17build: $(PACKAGE)-$(VERSION)/.build-done
18
19download: .download-done
20
21extract: $(PACKAGE)-$(VERSION)/.extract-done
22
23install: $(TARGETS)
24        (cd $(PACKAGE)-$(VERSION) && $(MAKE) $@)
25
26patch: $(PACKAGE)-$(VERSION)/.patch-done
27
28uninstall:
29        (cd $(PACKAGE)-$(VERSION) && $(MAKE) $@)
30
31clean:
32        if [ -f $(PACKAGE)-$(VERSION)/Makefile ]; then \
33                (cd $(PACKAGE)-$(VERSION) && $(MAKE) $@); \
34        fi
35
36distclean:
37        $(RM) -r $(PACKAGE)-$(VERSION)
38
39$(PACKAGE)-$(VERSION)/.extract-done: $(ARCHIVE)
40        $(TAR) -xzvf $(ARCHIVE)
41        $(TOUCH) $@
42
43$(PACKAGE)-$(VERSION)/.patch-done: $(PACKAGE)-$(VERSION)/.extract-done
44        for i in patches/*; do \
45                [ -f "$$i" ] && (cd $(PACKAGE)-$(VERSION) && patch -p1) \
46                                < "$$i"; \
47        done; \
48        $(TOUCH) $@
49
50$(PACKAGE)-$(VERSION)/.build-done: $(PACKAGE)-$(VERSION)/.patch-done
51        (cd $(PACKAGE)-$(VERSION) && $(MAKE))
52        $(TOUCH) $@
53
54$(ARCHIVE):
55        $(FETCH) $(URL)
56
57$(PACKAGE)-$(VERSION)/src/libc.so: $(PACKAGE)-$(VERSION)/.build-done
58
59.PHONY: all build clean distclean download extract install patch uninstall
Note: See TracBrowser for help on using the repository browser.