Makefile 2.25 KB
Newer Older
Per Cederqvist's avatar
Per Cederqvist committed
1
include Topdir.make
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

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


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

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

Per Cederqvist's avatar
Per Cederqvist committed
31
32
33
34
35
36
37
38
39
40
41
.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

42
depend: $(INCLUDEDIR) $(INCLUDEDIR)/m-config.h msg includes
43
44

distribution: clean
45
	find . -name #\*# -print
46
47
	-$(RM) -r lyskom-$(SERVER-VER)
	mkdir lyskom-$(SERVER-VER)
Per Cederqvist's avatar
Per Cederqvist committed
48
	cp Config 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
	cp src/libraries/Makefile lyskom-$(SERVER-VER)/src/libraries/
	cp -r doc lyskom-$(SERVER-VER)/doc
Per Cederqvist's avatar
Per Cederqvist committed
54
	cp -r config lyskom-$(SERVER-VER)/config
55
	cp -r scripts lyskom-$(SERVER-VER)/scripts
56
	$(RM) lyskom-$(SERVER-VER)/scripts/import.make
57
58
59
60
61
	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
62
	cp -r src/include lyskom-$(SERVER-VER)/src/include
63
	find lyskom-$(SERVER-VER) -name CVS.adm -print -exec rm -rf {} \; -prune
64
65
	tar cvf lyskom-$(SERVER-VER).tar lyskom-$(SERVER-VER)
	$(RM) lyskom-$(SERVER-VER).tar.Z
66
67
	compress lyskom-$(SERVER-VER).tar
	$(RM) -r lyskom-$(SERVER-VER)
Per Cederqvist's avatar
Per Cederqvist committed
68
69
70
71
72
73
74
75
76
77
78

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

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

79
$(INCLUDEDIR) $(INCLUDEDIR)/m-config.h:
Per Cederqvist's avatar
Per Cederqvist committed
80
81
	@echo You must run Config before Build or make.
	@exit 1