1 # Very basic and very simple Makefile. Maybe it would be nice to make it
2 # in ac/am.... but I'm too lazy ;)
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
12 PROFILEDIR = $(ETCDIR)/profile.d
13 ENVDIR = $(ETCDIR)/env.d
14 SHRCDIR = $(ETCDIR)/shrc.d
15 #########################################
17 BIN_FILES = joinpasswd update-fstab postshell delpasswd
19 ETC_FILES = filesystems fstab group host.conf hosts motd \
20 netgroup passwd profile protocols resolv.conf securetty \
21 services shells suid_profile subgid subuid
22 PROFILE_FILES = 00-tmp-dir.csh 00-tmp-dir.sh
23 ENV_FILES = EDITOR HISTFILESIZE HOME_ETC MAILCHECK MAILPATH \
24 NNTPSERVER ORGANIZATION TMOUT VISUAL
25 SHRC_FILES = 256term.csh 256term.sh
27 SOURCES = joinpasswd.c update-fstab.c postshell.c delpasswd.c
28 CLEAN = $(BIN_FILES) *.o core *.tar.gz *.tar.bz2 *~ *.swp
30 #########################################
33 joinpasswd: joinpasswd.o
34 update-fstab: update-fstab.o
35 postshell: postshell.o
36 delpasswd: delpasswd.o
39 $(CC) $(CPPFLAGS) $(CFLAGS) $(CDEFS) -c $< -o $@
43 cd etc; rm -f $(CLEAN)
44 cd etc/profile.d; rm -f $(CLEAN)
47 $(INSTALL) -d $(DESTDIR)/$(SBINDIR)
48 $(INSTALL) -d $(DESTDIR)/$(ETCDIR)
49 $(INSTALL) -d $(DESTDIR)/$(PROFILEDIR)
50 $(INSTALL) -d $(DESTDIR)/$(ENVDIR)
51 $(INSTALL) -d $(DESTDIR)/$(SHRCDIR)
52 $(INSTALL) $(BIN_FILES) $(DESTDIR)/$(SBINDIR)
53 cd etc; $(INSTALL) $(ETC_FILES) $(DESTDIR)/$(ETCDIR)
54 ln -sf /proc/self/mounts $(DESTDIR)/$(ETCDIR)/mtab
55 cd etc/profile.d; $(INSTALL) $(PROFILE_FILES) $(DESTDIR)/$(PROFILEDIR)
56 cd etc/env.d; $(INSTALL) $(ENV_FILES) $(DESTDIR)/$(ENVDIR)
57 cd etc/shrc.d; $(INSTALL) $(SHRC_FILES) $(DESTDIR)/$(SHRCDIR)
60 $(INSTALL) -d setup-$(VERSION)/etc/profile.d
61 $(INSTALL) -d setup-$(VERSION)/etc/env.d
62 $(INSTALL) -d setup-$(VERSION)/etc/shrc.d
63 $(INSTALL) $(DOCS) $(SOURCES) Makefile setup-$(VERSION)
64 for file in $(ETC_FILES); do \
65 $(INSTALL) -m644 etc/$$file setup-$(VERSION)/etc; \
67 for file in $(PROFILE_FILES); do \
68 $(INSTALL) -m755 etc/profile.d/$$file setup-$(VERSION)/etc/profile.d; \
70 for file in $(ENV_FILES); do \
71 $(INSTALL) -m644 etc/env.d/$$file setup-$(VERSION)/etc/env.d; \
73 for file in $(SHRC_FILES); do \
74 $(INSTALL) -m644 etc/shrc.d/$$file setup-$(VERSION)/etc/shrc.d; \
76 tar -cvjf setup-$(VERSION).tar.bz2 setup-$(VERSION)
77 rm -rf setup-$(VERSION)
83 cvs tag setup-$(shell echo $(VERSION) | tr . _)
86 lftp -c "open dropin; mput setup-$(VERSION).tar.bz2"