]> git.pld-linux.org Git - projects/setup.git/blob - Makefile
- new variables
[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.4.6
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)/profile.d
13 ENVDIR          = $(ETCDIR)/env.d
14 #########################################
15
16 BIN_FILES       = joinpasswd
17 DOCS            = ChangeLog
18 ETC_FILES       = filesystems fstab group host.conf hosts motd mtab \
19             netgroup passwd profile protocols resolv.conf securetty \
20             services shells suid_profile
21 PROFILE_FILES   = tmp-dir.csh tmp-dir.sh
22 ENV_FILES       = EDITOR HISTFILESIZE HOME_ETC MAILCHECK MAILPATH \
23             NNTPSERVER ORGANIZATION TMOUT VISUAL
24
25 SOURCES         = joinpasswd.c
26 CLEAN           = $(BIN_FILES) *.o core *.tar.gz *.tar.bz2 *~ *.swp
27
28 #########################################
29 all: joinpasswd
30
31 joinpasswd: joinpasswd.o
32
33 .c.o:
34         $(CC) $(CPPFLAGS) $(CFLAGS) $(CDEFS) -c $< -o $@
35
36 clean:
37         rm -f $(CLEAN)
38         cd etc; rm -f $(CLEAN)
39         cd etc/profile.d; rm -f $(CLEAN)
40
41 install:
42         $(INSTALL) -d $(DESTDIR)/$(SBINDIR)
43         $(INSTALL) -d $(DESTDIR)/$(ETCDIR)
44         $(INSTALL) -d $(DESTDIR)/$(PROFILEDIR)
45         $(INSTALL) -d  $(DESTDIR)/$(ENVDIR)
46         $(INSTALL) $(BIN_FILES) $(DESTDIR)/$(SBINDIR)
47         cd etc; $(INSTALL) $(ETC_FILES) $(DESTDIR)/$(ETCDIR)
48         cd etc/profile.d; $(INSTALL) $(PROFILE_FILES) $(DESTDIR)/$(PROFILEDIR)
49         cd etc/env.d; $(INSTALL) $(ENV_FILES) $(DESTDIR)/$(ENVDIR)
50
51 dist: clean
52         
53         $(INSTALL) -d setup-$(VERSION)/etc/profile.d
54         $(INSTALL) -d setup-$(VERSION)/etc/env.d
55         $(INSTALL) $(DOCS) $(SOURCES) Makefile setup-$(VERSION)
56         for file in $(ETC_FILES); do \
57                 $(INSTALL) etc/$$file setup-$(VERSION)/etc; \
58         done
59         for file in $(PROFILE_FILES); do \
60                 $(INSTALL) etc/profile.d/$$file setup-$(VERSION)/etc/profile.d; \
61         done
62         for file in $(ENV_FILES); do \
63                 $(INSTALL) etc/env.d/$$file setup-$(VERSION)/etc/env.d; \
64         done
65         tar -cvjf setup-$(VERSION).tar.bz2 setup-$(VERSION)
66         rm -rf setup-$(VERSION)
This page took 0.030816 seconds and 4 git commands to generate.