]> rtime.felk.cvut.cz Git - ulut.git/blob - ulut/Makefile.std
ul_dbuffprintf omitted from minimal build because vsnprintf is not supported by SDCC.
[ulut.git] / ulut / Makefile.std
1 #*******************************************************************
2 # uLan Communication - Makefile for uLan library compilation
3 #
4 #
5 # (C) Copyright 2001 by Pavel Pisa - Originator
6 #
7 # The uLan driver is distributed under the Gnu General Public License. 
8 # See file COPYING for details.
9 #
10 # Originator reserve the right to use and publish sources
11 # under different conditions too. If third party contributors
12 # do not accept this condition, they can delete this statement
13 # and only GNU license will apply.
14 #*******************************************************************
15
16 all : default
17
18 default : library tests
19
20 .PHONY : depend
21
22 # Select compiler
23 CC=gcc
24
25 # Basic compilation flags
26 CFLAGS += -Wall -Wstrict-prototypes 
27 CFLAGS += -O2
28 CFLAGS += -I.
29 CFLAGS += -ggdb
30 #CFLAGS += -pg
31 #CFLAGS += -std=c99
32 #CFLAGS += -std=gnu99 -DWITH_C99
33
34 # CFLAGS for the uLan library
35 # note: some macro expansions require at least -O
36 LCFLAGS=  $(CFLAGS)
37 LCFLAGS+= $(CPUFLAGS)
38 # uncomment the next line if you want a shared library
39 # LIB_SHARED = 1
40 #LCFLAGS += -pg
41
42 #LDFLAGS += -pg
43
44 LIB_OBJS  = ul_dbufbase.lo ul_dbufmore.lo ul_gsa.lo ul_gsacust.lo \
45             ul_gavlprim.lo ul_gavl.lo ul_hptree.lo \
46             ul_htimer.lo ul_htimbase.lo ul_htimmstime.lo \
47             ul_evcbase.lo ul_uniqid.lo ul_dbufflog.lo ul_logbase.lo \
48             ul_logreg.lo
49
50 # DJGPP = 1
51
52 ifndef LIB_SHARED
53
54 LIBULUT = libulut.a
55
56 %.lo: %.c
57         $(CC) -o $@ $(LCFLAGS) -c $<
58
59 $(LIBULUT): $(LIB_OBJS)
60         ar rcs $(LIBULUT) $^
61         ranlib $(LIBULUT)
62
63 else
64
65 %.lo: %.c
66         $(CC) --shared -o $@ $(LCFLAGS) -c $<
67
68 LIBULUT = libulut.so.0.0.4
69
70 $(LIBULUT): $(LIB_OBJS)
71         ld --shared --soname=$(LIBULUT) -o $(LIBULUT) $^
72         ln -s -f $(LIBULUT) libulan.so
73
74 endif
75
76 library: $(LIBULUT)
77
78 .SUFFIXES: .i .s
79 %.c : %.i
80         $(CC) -E $(CFLAGS) $< >$@
81
82 %.c : %.s
83         $(CC) -S $(CFLAGS) $<
84
85 dep:
86         $(CC) $(CFLAGS) $(CPPFLAGS) -w -E -M *.c $(MORE_C_FILES) | \
87         sed 's/^\([^:]*\)\.o *:/\1.o \1.lo:/g' > depend
88
89 depend:
90         @touch depend
91
92 clean :
93         rm -f depend *.o *.lo *~ *.a *.so *.so.* ul_gavlchk ul_htimchk ul_gsachk test
94
95 tests: ul_gsachk ul_gavlchk ul_htimchk
96
97 ul_gavlchk: ul_gavlchk.o libulut.a
98
99 ul_htimchk: ul_htimchk.o libulut.a
100
101 ul_gsachk: ul_gsachk.o libulut.a
102
103 -include depend