Makefile 1.39 KB
Newer Older
Per Cederqvist's avatar
.  
Per Cederqvist committed
1
2
3
4
5
TOPDIR = /usr/lyskom/src
SCRIPTDIR = $(TOPDIR)/scripts

include $(SCRIPTDIR)/import.make

6
TARGET = -DCLIENT
Per Cederqvist's avatar
.  
Per Cederqvist committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26


LIBOBJS = kom-errno.o misc-parser.o parser.o
HDRS = misc-parser.h parser.h
LIBRARIES = liblyskom-server.a liblyskom-client.a

all: $(LIBRARIES)

client-dir:
	mkdir client-dir
	ln -s `echo $(LIBOBJS) $(HDRS) dependencies| tr ' ' '\012' | \
	sed 's/.o$$/.c/' | sed 's:^:\.\./:' ` client-dir/

server-dir:
	mkdir server-dir
	ln -s `echo $(LIBOBJS) $(HDRS) dependencies| tr ' ' '\012' | \
	sed 's/.o$$/.c/' | sed 's:^:\.\./:' ` server-dir/

.PHONY: liblyskom-server.a
liblyskom-server.a: server-dir
27
	(cd server-dir; make $(EXPORTS) -f ../Makefile ../$@ TARGET=-DSERVER)
Per Cederqvist's avatar
.  
Per Cederqvist committed
28
29
30
31
32
33
34
35
	ranlib $@


../liblyskom-server.a: $(LIBOBJS) 
	$(AR) $(ARFLAGS) $@ $?

.PHONY: liblyskom-client.a
liblyskom-client.a: client-dir
36
	(cd client-dir; make $(EXPORTS) -f ../Makefile ../$@ TARGET=-DCLIENT)
Per Cederqvist's avatar
.  
Per Cederqvist committed
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
	ranlib $@


../liblyskom-client.a: $(LIBOBJS) 
	$(AR) $(ARFLAGS) $@ $?


clean:
	$(RM) -r *.o core Distfile *~ client-dir server-dir $(LIBRARIES)

install: all install-headers
	(cd $(LIBDIR); $(RM)  $(LIBRARIES))
	cp $(LIBRARIES) $(LIBDIR)
	(cd $(LIBDIR); ranlib -t $(LIBRARIES))

.PHONY: install-headers
install-headers:
	(cd $(INCLUDEDIR); $(RM) $(HDRS))
	cp $(HDRS) $(INCLUDEDIR)

tags:
	etags -t $(INCLUDEDIR)/*.h *.[hc]	

# Recreate the Makefile from Makefile

include $(SCRIPTDIR)/Parallell-depend.make

specials:;

include dependencies