]> rtime.felk.cvut.cz Git - can-usb1.git/blob - ulan/host/ul_drv/ul_lib/Makefile.std
Initializing repo
[can-usb1.git] / ulan / host / ul_drv / ul_lib / Makefile.std
1 #*******************************************************************
2 # uLan Communication - Makefile for uLan library compilation
3 #
4 # (C) Copyright 2000 by Pavel Pisa 
5 #
6 # The uLan driver is distributed under the Gnu General Public Licence. 
7 # See file COPYING for details.
8 #
9 # Author reserves right to use and publish sources for embedded 
10 # applications under different conditions too.
11 #*******************************************************************
12
13 all : default
14
15 default : library
16
17 # Select compiler
18 CC=gcc
19
20 # Basic compilation flags
21 CFLAGS += -Wall -Wstrict-prototypes 
22 CFLAGS += -O2
23 CFLAGS += -I. -I..
24 CFLAGS += -ggdb
25
26 # CFLAGS for the uLan library
27 # note: some macro expansions require at least -O
28 LCFLAGS=  $(CFLAGS)
29 LCFLAGS+= $(CPUFLAGS)
30 # uncomment the next line if you want a shared library
31 # LIB_SHARED = 1
32
33 LIB_OBJS = ul_l_drv.lo ul_l_msg.lo ul_l_oi.lo ul_l_log.lo
34
35 # DJGPP = 1
36
37 ifdef DJGPP
38
39 LIB_OBJS += ul_drv.lo
40
41 MORE_C_FILES += ../ul_drv/ul_drv.c
42
43 ul_drv.lo: ../ul_drv/ul_drv.c
44         $(CC) -o $@ $(LCFLAGS) -D UL_WITH_PCI -I ../ul_drv -c $<
45
46 endif
47
48 ifndef LIB_SHARED
49
50 LIBULAN = libulan.a
51
52 %.lo: %.c
53         $(CC) -o $@ $(LCFLAGS) -c $<
54
55 $(LIBULAN): $(LIB_OBJS)
56         ar rcs $(LIBULAN) $^
57         ranlib $(LIBULAN)
58
59 else
60
61 %.lo: %.c
62         $(CC) --shared -o $@ $(LCFLAGS) -c $<
63
64 LIBULAN = libulan.so.0.0.4
65
66 $(LIBULAN): $(LIB_OBJS)
67         ld --shared --soname=$(LIBULAN) -o $(LIBULAN) $^
68         ln -s -f $(LIBULAN) libulan.so
69
70 endif
71
72 ul_lib/ul_fd.h : ul_lib/ul_fd4dir.h
73         cp $< $@
74
75 library : ul_lib/ul_fd.h 
76
77 library: $(LIBULAN)
78
79 .SUFFIXES: .i .s
80 %.c : %.i
81         $(CC) -E $(CFLAGS) $< >$@
82
83 %.c : %.s
84         $(CC) -S $(CFLAGS) $<
85
86 dep:
87         $(CC) $(CFLAGS) $(CPPFLAGS) -w -E -M *.c $(MORE_C_FILES) | \
88         sed 's/\.o/.lo/g' > depend
89
90 depend:
91         @touch depend
92
93 clean :
94         rm -f depend *.o *.lo *~ *.a *.so *.so.*
95
96 -include depend