Makefile 2.15 KB
Newer Older
Per Cederqvist's avatar
Per Cederqvist committed
1
TOPDIR := $(shell pwd)
Per Cederqvist's avatar
.  
Per Cederqvist committed
2
3
4
5
SCRIPTDIR = $(TOPDIR)/scripts

include $(SCRIPTDIR)/import.make

Per Cederqvist's avatar
Per Cederqvist committed
6
SUBDIRS = doc junk scripts src config
7
SERVER-VER = 1.0
Per Cederqvist's avatar
.  
Per Cederqvist committed
8

Per Cederqvist's avatar
Per Cederqvist committed
9
all: msg includes libraries binaries end-msg
10

Per Cederqvist's avatar
Per Cederqvist committed
11
includes: $(INCLUDEDIR)/m-config.h
12
13
14
	-mkdir $(INCLUDEDIR)
	for i in $(SUBDIRS) ;	\
	do	\
15
16
		[ -d $$i ] && { echo making includes in directory $$i; \
		(cd $$i; $(MAKE) $(EXPORTS) includes) }	\
17
18
19
	done


Per Cederqvist's avatar
Per Cederqvist committed
20
libraries: $(INCLUDEDIR)/m-config.h
Per Cederqvist's avatar
Per Cederqvist committed
21
	-mkdir $(LIBDIR)
Per Cederqvist's avatar
.  
Per Cederqvist committed
22
23
	for i in $(SUBDIRS) ;	\
	do	\
24
25
		[ -d $$i ] && { echo making libraries in directory $$i; \
		(cd $$i; $(MAKE) $(EXPORTS) libraries) }  \
26
27
	done

28
29
30
include $(SCRIPTDIR)/sub-binaries.make
include $(SCRIPTDIR)/sub-install.make
include $(SCRIPTDIR)/sub-depend.make
31

Per Cederqvist's avatar
Per Cederqvist committed
32
33
34
35
36
37
38
39
40
41
42
43
.PHONY: clean
clean:
	$(RM) $(GENERIC-CLEAN)
	$(RM) -r $(INCLUDEDIR)
	$(RM) -r $(LIBDIR)
	-for i in $(SUBDIRS); \
	do \
	   [ -d $$i ] && { echo making clean in directory $$i; \
	   (cd $$i; $(MAKE) $(EXPORTS) clean) } \
	done

depend: $(INCLUDEDIR)/m-config.h msg includes
44
45
46
47

distribution: clean
	-$(RM) -r lyskom-$(SERVER-VER)
	mkdir lyskom-$(SERVER-VER)
48
	cp Build Makefile lyskom-$(SERVER-VER)/
49
	mkdir lyskom-$(SERVER-VER)/src
50
	cp src/Makefile lyskom-$(SERVER-VER)/src/
51
	mkdir lyskom-$(SERVER-VER)/src/libraries
52
53
54
	cp src/libraries/Makefile lyskom-$(SERVER-VER)/src/libraries/
	cp -r doc lyskom-$(SERVER-VER)/doc
	cp -r scripts lyskom-$(SERVER-VER)/scripts
55
	$(RM) lyskom-$(SERVER-VER)/scripts/import.make
56
57
58
59
60
	cp -r src/libraries/libansi lyskom-$(SERVER-VER)/src/libraries
	cp -r src/libraries/libcommon lyskom-$(SERVER-VER)/src/libraries
	cp -r src/libraries/libisc lyskom-$(SERVER-VER)/src/libraries
	cp -r src/libraries/libmisc lyskom-$(SERVER-VER)/src/libraries
	cp -r src/server lyskom-$(SERVER-VER)/src
61
	cp -r src/include lyskom-$(SERVER-VER)/src/include
62
	find lyskom-$(SERVER-VER) -name CVS.adm -print -exec rm -rf {} \; -prune
63
64
	tar cvf lyskom-$(SERVER-VER).tar lyskom-$(SERVER-VER)
	$(RM) lyskom-$(SERVER-VER).tar.Z
65
66
	compress lyskom-$(SERVER-VER).tar
	$(RM) -r lyskom-$(SERVER-VER)
Per Cederqvist's avatar
Per Cederqvist committed
67
68
69
70
71
72
73
74
75
76
77
78
79
80

msg:
	@echo Top-level source directory is believed to be $(TOPDIR)
	@date
	@echo

end-msg:
	@echo
	@echo Finished at
	@date

$(INCLUDEDIR)/m-config.h:
	@echo You must run Config before Build or make.
	@exit 1
81