]>
Commit | Line | Data |
---|---|---|
e040c79e PG |
1 | # Very basic and very simple Makefile. Maybe it would be nice to make it |
2 | # in ac/am.... but I'm too lazy ;) | |
3 | # | |
807243ae | 4 | VERSION = 2.4.4 |
e040c79e PG |
5 | |
6 | CC = gcc | |
7 | OPT_FLAGS = -O2 -g | |
8 | CFLAGS = $(OPT_FLAGS) -Wall | |
9 | INSTALL = install | |
10 | SBINDIR = /sbin | |
11 | ETCDIR = /etc | |
12 | PROFILEDIR = $(ETCDIR)/profil.d | |
13 | ######################################### | |
14 | ||
15 | BIN_FILES = joinpasswd | |
16 | DOCS = ChangeLog | |
17 | ETC_FILES = filesystems fstab group host.conf hosts motd mtab \ | |
18 | netgroup passwd profile protocols resolv.conf securetty \ | |
19 | services shells | |
20 | PROFILE_FILES = tmp-dir.csh tmp-dir.sh | |
21 | ||
22 | SOURCES = joinpasswd.c | |
23 | CLEAN = $(BIN_FILES) *.o core *.tar.gz *.tar.bz2 *~ *.swp | |
24 | ||
25 | ######################################### | |
26 | all: joinpasswd | |
27 | ||
28 | joinpasswd: joinpasswd.o | |
29 | ||
30 | .c.o: | |
31 | $(CC) $(CPPFLAGS) $(CFLAGS) $(CDEFS) -c $< -o $@ | |
32 | ||
33 | clean: | |
34 | rm -f $(CLEAN) | |
35 | cd etc; rm -f $(CLEAN) | |
36 | cd etc/profile.d; rm -f $(CLEAN) | |
37 | ||
38 | install: | |
39 | $(INSTALL) -d $(DESTDIR)/$(SBINDIR) | |
40 | $(INSTALL) -d $(DESTDIR)/$(ETCDIR) | |
41 | $(INSTALL) -d $(DESTDIR)/$(PROFILEDIR) | |
42 | $(INSTALL) $(BIN_FILES) $(DESTDIR)/$(SBINDIR) | |
43 | cd etc; $(INSTALL) $(ETC_FILES) $(DESTDIR)/$(ETCDIR) | |
44 | cd etc/profile.d; $(INSTALL) $(PROFILE_FILES) $(DESTDIR)/$(PROFILEDIR) | |
45 | ||
46 | dist: clean | |
47 | ||
48 | $(INSTALL) -d setup-$(VERSION)/etc/profile.d | |
49 | $(INSTALL) $(DOCS) $(SOURCES) setup-$(VERSION) | |
50 | for file in $(ETC_FILES); do \ | |
51 | $(INSTALL) etc/$$file setup-$(VERSION)/etc; \ | |
52 | done | |
53 | for file in $(PROFILE_FILES); do \ | |
54 | $(INSTALL) etc/profile.d/$$file setup-$(VERSION)/etc/profile.d; \ | |
55 | done | |
56 | tar -cvjf setup-$(VERSION).tar.bz2 setup-$(VERSION) | |
57 | rm -rf setup-$(VERSION) |