Makefile 2.22 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
45
46

distribution: clean
	-$(RM) -r lyskom-$(SERVER-VER)
	mkdir lyskom-$(SERVER-VER)
Per Cederqvist's avatar
Per Cederqvist committed
47
	cp Config Build Makefile lyskom-$(SERVER-VER)/
48
	mkdir lyskom-$(SERVER-VER)/src
49
	cp src/Makefile lyskom-$(SERVER-VER)/src/
50
	mkdir lyskom-$(SERVER-VER)/src/libraries
51
52
	cp src/libraries/Makefile lyskom-$(SERVER-VER)/src/libraries/
	cp -r doc lyskom-$(SERVER-VER)/doc
Per Cederqvist's avatar
Per Cederqvist committed
53
	cp -r config lyskom-$(SERVER-VER)/config
54
	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

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

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

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