win-pvdrivers

annotate liblfds.6/makefile.linux @ 1075:5e8aeb18279c

Add export methods to retrieve and set the hypercall stubs for the dump_xenpci driver
author James Harper <james.harper@bendigoit.com.au>
date Mon Dec 09 13:30:14 2013 +1100 (2013-12-09)
parents 6300617040e0
children
rev   line source
james@766 1 ##### paths #####
james@766 2 BINDIR = bin
james@766 3 INCDIR = inc
james@766 4 OBJDIR = obj
james@766 5 SRCDIR = src
james@766 6
james@766 7 ##### misc #####
james@766 8 QUIETLY = 1>/dev/null 2>/dev/null
james@766 9
james@766 10 ##### sources, objects and libraries #####
james@766 11 BINNAME = liblfds
james@766 12 AR_BINARY = $(BINDIR)/$(BINNAME).a
james@766 13 SO_BINARY = $(BINDIR)/$(BINNAME).so
james@766 14 SRCDIRS = abstraction freelist queue ringbuffer slist stack
james@766 15 # TRD : be aware - in the linux makefile, with the one-pass linking behaviour of the GNU linker, the order
james@766 16 # of source files matters! this is because it leads to the ordering of objects in the library and
james@766 17 # that in turn, since the data structures all use the freelist API and the abstraction API, has to be
james@766 18 # correct
james@766 19 SOURCES = queue_delete.c queue_new.c queue_query.c queue_queue.c \
james@766 20 ringbuffer_delete.c ringbuffer_get_and_put.c ringbuffer_new.c ringbuffer_query.c \
james@766 21 slist_delete.c slist_get_and_set.c slist_link.c slist_new.c \
james@766 22 stack_delete.c stack_new.c stack_push_pop.c stack_query.c \
james@766 23 freelist_delete.c freelist_get_and_set.c freelist_new.c freelist_query.c freelist_pop_push.c \
james@766 24 abstraction_aligned_free.c abstraction_aligned_malloc.c abstraction_cas.c abstraction_dcas.c abstraction_increment.c
james@766 25 OBJECTS = $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(SOURCES)))
james@766 26
james@766 27 ##### CPU variants #####
james@766 28 GCCARCH = $(shell uname -m)
james@766 29
james@766 30 ifeq ($(GCCARCH),x86_64)
james@766 31 GCCARCH = core2
james@766 32 endif
james@766 33
james@766 34 ifeq ($(findstring arm,$(GCCARCH)),arm)
james@766 35 GCCARCH = armv6k
james@766 36 endif
james@766 37
james@766 38 ##### tools #####
james@766 39 MAKE = make
james@766 40 MFLAGS =
james@766 41
james@766 42 DG = gcc
james@766 43 DGFLAGS = -MM -std=c99 -I"$(SRCDIR)" -I"$(INCDIR)"
james@766 44
james@766 45 CC = gcc
james@766 46 CBASE = -Wall -Wno-unknown-pragmas -std=c99 -march=$(GCCARCH) -c -I"$(SRCDIR)" -I"$(INCDIR)"
james@766 47 CFREL = -O2 -finline-functions -Wno-strict-aliasing
james@766 48 CFDBG = -O0 -g
james@766 49
james@766 50 AR = ar
james@766 51 AFLAGS = -rcs
james@766 52
james@766 53 LD = gcc
james@766 54 LFBASE = -Wall -std=c99 -shared
james@766 55 LFREL = -O2 -s
james@766 56 LFDBG = -O0 -g
james@766 57
james@766 58 ##### rel/dbg .a/.so variants #####
james@766 59 ifeq ($(findstring so,$(MAKECMDGOALS)),so)
james@766 60 CBASE := $(CBASE) -fpic
james@766 61 endif
james@766 62
james@766 63 CFLAGS = $(CBASE) $(CFDBG)
james@766 64 LFLAGS = $(LFBASE) $(LFDBG)
james@766 65
james@766 66 ifeq ($(findstring rel,$(MAKECMDGOALS)),rel)
james@766 67 CFLAGS = $(CBASE) $(CFREL)
james@766 68 LFLAGS = $(LFBASE) $(LFREL)
james@766 69 endif
james@766 70
james@766 71 ##### search paths #####
james@766 72 vpath %.c $(patsubst %,$(SRCDIR)/%:,$(SRCDIRS))
james@766 73
james@766 74 ##### implicit rules #####
james@766 75 $(OBJDIR)/%.o : %.c
james@766 76 $(DG) $(DGFLAGS) $< >$(OBJDIR)/$*.d
james@766 77 $(CC) $(CFLAGS) -o $@ $<
james@766 78
james@766 79 ##### explicit rules #####
james@766 80 $(AR_BINARY) : $(OBJECTS)
james@766 81 $(AR) $(AFLAGS) $(AR_BINARY) $(OBJECTS)
james@766 82
james@766 83 $(SO_BINARY) : $(OBJECTS)
james@766 84 $(LD) $(LFLAGS) $(SYSLIBS) $(OBJECTS) -o $(SO_BINARY)
james@766 85
james@766 86 ##### phony #####
james@766 87 .PHONY : clean arrel ardbg sorel sodbg
james@766 88
james@766 89 clean :
james@766 90 @rm -f $(BINDIR)/$(BINNAME).* $(OBJDIR)/*.o $(OBJDIR)/*.d
james@766 91
james@766 92 arrel : $(AR_BINARY)
james@766 93 ardbg : $(AR_BINARY)
james@766 94
james@766 95 sorel : $(SO_BINARY)
james@766 96 sodbg : $(SO_BINARY)
james@766 97
james@766 98 ##### dependencies #####
james@766 99 -include $(DEPENDS)
james@766 100
james@766 101 ##### notes #####
james@766 102 # TRD : we use -std=c99 purely to permit C++ style comments
james@766 103