lib.mk 1000 Bytes
Newer Older
1
##---------------------------------------------------------------------------
2
3
4
5
##
## Makefile Template for Libraries
##

6
all-common: $(LIBRARY) $(PROGRAMS)
7
8
9
10
11
12
13

$(LIBRARY): version.o
	$(AR) ru $@ $(OBJS) version.o
	@$(RANLIB) $@;	\
	$(RM) ../$@;	\
	(d=`$(PWD)` ; $(LN_S) `$(BASENAME) $$d`/$@ ../$@)

14
version.c: $(OBJS) $(srcdir)/Version.c
15
16
17
18
19
	$(RM) $@
	(u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` \
	h=`$(HOSTNAME)` t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
	-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
	-e "s|%VERSION%|$${v}|" \
20
	< $(srcdir)/Version.c > $@)
21

22
install-common: all-common install-local
23

24
lint: lint-local FORCE
25
26
	$(LINT) $(DEFS) $(DEFINES) $(SRCS)

27
lint5: lint5-local FORCE
28
29
	$(5LINT) $(DEFS) $(DEFINES) $(SRCS)

30
clean-common: 	clean-local
31
32
33
	$(RM) $(LIBRARY) ../$(LIBRARY) $(PROGRAMS) $(XPROGRAMS) $(XSRCS) \
		*.o a.out core version.c

34
depend-common: depend-local
35
36
	$(MKDEP) $(DEFS) $(DEFINES) $(SRCS)

37
38
39
40
veryclean-common: veryclean-local clean-common

lint-local: FORCE
lint5-local: FORCE