summaryrefslogtreecommitdiffstats
path: root/loader/kon2/Makefile
blob: fcfdd8ea696c2d2c440f03e469db35abef5a4b49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
VERSION	= 0.3

ifeq (.config,$(wildcard .config))
include .config
endif

INCDIR  = $(shell pwd)/include
LIB     = $(shell pwd)/lib/libgon.a

MFLAGS = INCDIR=$(INCDIR) LIB=$(LIB)

CC = diet gcc
MAKE := $(MAKE) "CC=$(CC)"

ifdef	MINI_KON
SUBDIRS = lib src
else
SUBDIRS = lib src font tools
endif

all:	subdirs

version:
	@expr `cat .VERSION` + 1 > .VERSION
	@echo \#define	VERSION	\"ver.$(VERSION).`cat .VERSION` \(`date +%m/%d`\)\" > include/version.h

config:
	@sh tools/Configure.linux < config.in.linux
	-for i in $(SUBDIRS) src/display; do \
	(cd $$i && test -f Makefile.linux && cp Makefile.linux Makefile) ; \
	done
	cp Makefile.linux Makefile

subdirs:
	echo $(MFLAGS)
	@for i in $(SUBDIRS);\
	do (cd $$i && echo making all in $$i && $(MAKE) $(MFLAGS)) || exit;\
	done

depend:
	@for i in $(SUBDIRS);\
	do (cd $$i && echo building dependencies in $$i && $(MAKE) depend) || exit;\
	done

clean:
	$(RM) -f *~ include/*~ doc/*~ .depend .config config.out
	@for i in $(SUBDIRS);\
	do (cd $$i && echo cleaning all in $$i && $(MAKE) clean);\
	done

install: makedir instbin
	@if [ -f $(LIBDIR)/$(CONFIG_NAME) ]; then\
		mv $(LIBDIR)/$(CONFIG_NAME) $(LIBDIR)/$(CONFIG_NAME)'.org';\
		echo $(LIBDIR)/$(CONFIG_NAME)': file exists ... renamed !!';\
	fi
	@install -c $(CONFIG_NAME).linux $(LIBDIR)/${CONFIG_NAME}
	install -c doc/kon.1 $(MANDIR)

makedir:
	@sh tools/makedir $(BINDIR)
	@sh tools/makedir $(LIBDIR)
	@sh tools/makedir $(MANDIR)

instbin:
	@for i in $(SUBDIRS);\
	do (cd $$i && echo installing all in $$i && $(MAKE) install);\
	done