File: Makefile

package info (click to toggle)
dmx4linux 2.5%2Bdfsg-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,660 kB
  • ctags: 2,835
  • sloc: ansic: 23,341; yacc: 918; asm: 846; makefile: 614; sh: 439
file content (48 lines) | stat: -rw-r--r-- 1,116 bytes parent folder | download
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
include ../config.mk

OBJ=	open.o sleep.o
LOBJ=	$(OBJ:%.o=%.lo)

STATIC=	libdmx4linux.a

STEMNAME=libdmx4linux.so
SONAME=$(STEMNAME).2
LIBNAME=$(SONAME).5

all:	$(STATIC) $(LIBNAME)

$(STATIC):	$(OBJ)
	ar rcs $@ $^

$(LIBNAME):	$(LOBJ)
	$(CC) -shared -Wl,-soname,$(SONAME) -o $@ $^ -lc
	ln -sf $@ $(SONAME)
	ln -sf $(SONAME) $(STEMNAME)

install:	all
	install -d $(LIBINSTALLPATH) $(HEADERINSTALLPATH)
	install -m 644 $(STATIC) $(LIBINSTALLPATH)
	install -m 755 $(LIBNAME) $(LIBINSTALLPATH)
	cp -d $(STEMNAME) $(LIBINSTALLPATH)
ifeq ($(strip $(CROSS)),)
	$(LDCONFIG) -n $(LIBINSTALLPATH)
endif
	if [ ! -d $(HEADERINSTALLPATH)/dmx ]; then mkdir -p $(HEADERINSTALLPATH)/dmx; fi
	install -m 644 ../include/dmx/dmx.h $(HEADERINSTALLPATH)/dmx4linux
	install -m 644 ../include/dmx/dmxioctl.h $(HEADERINSTALLPATH)/dmx4linux

clean:	
	rm -f $(OBJ) $(LOBJ) $(STATIC) $(STEMNAME) $(SONAME) $(LIBNAME) *~

distclean:	clean uninstall

uninstall:
	rm -f $(LIBINSTALLPATH)/$(STATIC)
	rm -f $(LIBINSTALLPATH)/$(LIBNAME)
	rm -rf $(HEADERINSTALLPATH)/dmx4linux

doxy:	
	doxygen Doxyfile

%.lo:	%.c
	$(CC) $(CFLAGS) -fPIC -c -o $@ $<