win-pvdrivers

view liblfds.6/makefile.linux @ 766:6300617040e0

Big changes - not ready for production use.
Removed all the custom DMA handling code as it was completely incompatible with the Windows verifier.
Added liblfds (using the lock free stack) from liblfds.org so that grant's can be obtained at DIRQL.
Fixed xennet and xenvbd to support the changes.
xenusb and xenscsi almost certainly will not yet work after the changes.
author James Harper <james.harper@bendigoit.com.au>
date Sun Jan 31 21:28:42 2010 +1100 (2010-01-31)
parents
children
line source
1 ##### paths #####
2 BINDIR = bin
3 INCDIR = inc
4 OBJDIR = obj
5 SRCDIR = src
7 ##### misc #####
8 QUIETLY = 1>/dev/null 2>/dev/null
10 ##### sources, objects and libraries #####
11 BINNAME = liblfds
12 AR_BINARY = $(BINDIR)/$(BINNAME).a
13 SO_BINARY = $(BINDIR)/$(BINNAME).so
14 SRCDIRS = abstraction freelist queue ringbuffer slist stack
15 # TRD : be aware - in the linux makefile, with the one-pass linking behaviour of the GNU linker, the order
16 # of source files matters! this is because it leads to the ordering of objects in the library and
17 # that in turn, since the data structures all use the freelist API and the abstraction API, has to be
18 # correct
19 SOURCES = queue_delete.c queue_new.c queue_query.c queue_queue.c \
20 ringbuffer_delete.c ringbuffer_get_and_put.c ringbuffer_new.c ringbuffer_query.c \
21 slist_delete.c slist_get_and_set.c slist_link.c slist_new.c \
22 stack_delete.c stack_new.c stack_push_pop.c stack_query.c \
23 freelist_delete.c freelist_get_and_set.c freelist_new.c freelist_query.c freelist_pop_push.c \
24 abstraction_aligned_free.c abstraction_aligned_malloc.c abstraction_cas.c abstraction_dcas.c abstraction_increment.c
25 OBJECTS = $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(SOURCES)))
27 ##### CPU variants #####
28 GCCARCH = $(shell uname -m)
30 ifeq ($(GCCARCH),x86_64)
31 GCCARCH = core2
32 endif
34 ifeq ($(findstring arm,$(GCCARCH)),arm)
35 GCCARCH = armv6k
36 endif
38 ##### tools #####
39 MAKE = make
40 MFLAGS =
42 DG = gcc
43 DGFLAGS = -MM -std=c99 -I"$(SRCDIR)" -I"$(INCDIR)"
45 CC = gcc
46 CBASE = -Wall -Wno-unknown-pragmas -std=c99 -march=$(GCCARCH) -c -I"$(SRCDIR)" -I"$(INCDIR)"
47 CFREL = -O2 -finline-functions -Wno-strict-aliasing
48 CFDBG = -O0 -g
50 AR = ar
51 AFLAGS = -rcs
53 LD = gcc
54 LFBASE = -Wall -std=c99 -shared
55 LFREL = -O2 -s
56 LFDBG = -O0 -g
58 ##### rel/dbg .a/.so variants #####
59 ifeq ($(findstring so,$(MAKECMDGOALS)),so)
60 CBASE := $(CBASE) -fpic
61 endif
63 CFLAGS = $(CBASE) $(CFDBG)
64 LFLAGS = $(LFBASE) $(LFDBG)
66 ifeq ($(findstring rel,$(MAKECMDGOALS)),rel)
67 CFLAGS = $(CBASE) $(CFREL)
68 LFLAGS = $(LFBASE) $(LFREL)
69 endif
71 ##### search paths #####
72 vpath %.c $(patsubst %,$(SRCDIR)/%:,$(SRCDIRS))
74 ##### implicit rules #####
75 $(OBJDIR)/%.o : %.c
76 $(DG) $(DGFLAGS) $< >$(OBJDIR)/$*.d
77 $(CC) $(CFLAGS) -o $@ $<
79 ##### explicit rules #####
80 $(AR_BINARY) : $(OBJECTS)
81 $(AR) $(AFLAGS) $(AR_BINARY) $(OBJECTS)
83 $(SO_BINARY) : $(OBJECTS)
84 $(LD) $(LFLAGS) $(SYSLIBS) $(OBJECTS) -o $(SO_BINARY)
86 ##### phony #####
87 .PHONY : clean arrel ardbg sorel sodbg
89 clean :
90 @rm -f $(BINDIR)/$(BINNAME).* $(OBJDIR)/*.o $(OBJDIR)/*.d
92 arrel : $(AR_BINARY)
93 ardbg : $(AR_BINARY)
95 sorel : $(SO_BINARY)
96 sodbg : $(SO_BINARY)
98 ##### dependencies #####
99 -include $(DEPENDS)
101 ##### notes #####
102 # TRD : we use -std=c99 purely to permit C++ style comments