]> git.pld-linux.org Git - projects/setup.git/blob - Makefile
Always enable largefile.
[projects/setup.git] / Makefile
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 #
4 VERSION         = 2.8.5
5
6 CC              = gcc
7 OPT_FLAGS       = -Wformat -Werror=format-security -fvar-tracking-assignments -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector -O2 -g2 -Wall
8 CFLAGS          = $(OPT_FLAGS) -Wall -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
9 INSTALL         = install
10 SBINDIR         = /sbin
11 ETCDIR          = /etc
12 PROFILEDIR      = $(ETCDIR)/profile.d
13 ENVDIR          = $(ETCDIR)/env.d
14 SHRCDIR         = $(ETCDIR)/shrc.d
15 #########################################
16
17 BIN_FILES       = joinpasswd update-fstab postshell delpasswd
18 DOCS            = ChangeLog
19 ETC_FILES       = filesystems fstab group host.conf hosts motd \
20             netgroup passwd profile protocols resolv.conf securetty \
21             services shells suid_profile
22 PROFILE_FILES   = tmp-dir.csh tmp-dir.sh
23 ENV_FILES       = EDITOR HISTFILESIZE HOME_ETC MAILCHECK MAILPATH \
24             NNTPSERVER ORGANIZATION TMOUT VISUAL
25
26 SOURCES         = joinpasswd.c update-fstab.c postshell.c delpasswd.c
27 CLEAN           = $(BIN_FILES) *.o core *.tar.gz *.tar.bz2 *~ *.swp
28
29 #########################################
30 all: $(BIN_FILES)
31
32 joinpasswd: joinpasswd.o
33 update-fstab: update-fstab.o
34 postshell: postshell.o
35 delpasswd: delpasswd.o
36
37 .c.o:
38         $(CC) $(CPPFLAGS) $(CFLAGS) $(CDEFS) -c $< -o $@
39
40 clean:
41         rm -f $(CLEAN)
42         cd etc; rm -f $(CLEAN)
43         cd etc/profile.d; rm -f $(CLEAN)
44
45 install:
46         $(INSTALL) -d $(DESTDIR)/$(SBINDIR)
47         $(INSTALL) -d $(DESTDIR)/$(ETCDIR)
48         $(INSTALL) -d $(DESTDIR)/$(PROFILEDIR)
49         $(INSTALL) -d  $(DESTDIR)/$(ENVDIR)
50         $(INSTALL) $(BIN_FILES) $(DESTDIR)/$(SBINDIR)
51         cd etc; $(INSTALL) $(ETC_FILES) $(DESTDIR)/$(ETCDIR)
52         ln -sf /proc/self/mounts $(DESTDIR)/$(ETCDIR)/mtab
53         cd etc/profile.d; $(INSTALL) $(PROFILE_FILES) $(DESTDIR)/$(PROFILEDIR)
54         cd etc/env.d; $(INSTALL) $(ENV_FILES) $(DESTDIR)/$(ENVDIR)
55
56 dist: changelog clean
57         $(INSTALL) -d setup-$(VERSION)/etc/profile.d
58         $(INSTALL) -d setup-$(VERSION)/etc/env.d
59         $(INSTALL) -d setup-$(VERSION)/etc/shrc.d
60         $(INSTALL) $(DOCS) $(SOURCES) Makefile setup-$(VERSION)
61         for file in $(ETC_FILES); do \
62                 $(INSTALL) -m644 etc/$$file setup-$(VERSION)/etc; \
63         done
64         for file in $(PROFILE_FILES); do \
65                 $(INSTALL) -m755 etc/profile.d/$$file setup-$(VERSION)/etc/profile.d; \
66         done
67         for file in $(ENV_FILES); do \
68                 $(INSTALL) -m644 etc/env.d/$$file setup-$(VERSION)/etc/env.d; \
69         done
70         tar -cvjf setup-$(VERSION).tar.bz2 setup-$(VERSION)
71         rm -rf setup-$(VERSION)
72
73 changelog:
74         ./changelog.sh
75
76 tag:
77         cvs tag setup-$(shell echo $(VERSION) | tr . _)
78
79 distfiles: dist
80         lftp -c "open dropin; mput setup-$(VERSION).tar.bz2"
This page took 0.259397 seconds and 4 git commands to generate.