2014-04-11 07:53:42 +02:00
|
|
|
CC=gcc
|
|
|
|
LD = ld
|
|
|
|
AR= ar
|
2013-12-15 14:26:11 +01:00
|
|
|
|
|
|
|
LIBRARY= libdrm
|
|
|
|
|
|
|
|
CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -fomit-frame-pointer
|
|
|
|
|
|
|
|
STRIP = $(PREFIX)strip
|
|
|
|
|
|
|
|
LDFLAGS:= -shared -s -nostdlib -T ../newlib/dll.lds --entry _DllStartup --version-script libdrm.ver --image-base=0 --out-implib $(LIBRARY).dll.a
|
|
|
|
|
|
|
|
INCLUDES= -I. -I./include/drm -I../newlib/include
|
|
|
|
|
|
|
|
LIBPATH:= -L../../lib
|
|
|
|
|
|
|
|
LIBS:= -ldll -lc.dll
|
|
|
|
|
|
|
|
|
|
|
|
DEFINES=
|
|
|
|
|
|
|
|
|
|
|
|
SOURCES = xf86drm.c \
|
|
|
|
intel/intel_bufmgr.c \
|
|
|
|
intel/intel_bufmgr_gem.c
|
|
|
|
|
|
|
|
|
|
|
|
OBJECTS = $(patsubst %.c, %.o, $(SOURCES))
|
|
|
|
|
|
|
|
|
|
|
|
# targets
|
|
|
|
|
|
|
|
|
|
|
|
all:$(LIBRARY).a $(LIBRARY).dll
|
|
|
|
|
|
|
|
|
|
|
|
$(LIBRARY).a: $(OBJECTS) Makefile
|
|
|
|
ar cvrs $(LIBRARY).a $(OBJECTS)
|
|
|
|
mv -f $(LIBRARY).a ../../lib
|
|
|
|
|
|
|
|
$(LIBRARY).dll: $(OBJECTS) Makefile
|
|
|
|
$(LD) $(LDFLAGS) $(LIBPATH) -o $@ $(OBJECTS) $(LIBS)
|
|
|
|
$(STRIP) $@
|
|
|
|
mv -f $@ ../../bin
|
|
|
|
mv -f $(LIBRARY).dll.a ../../lib
|
|
|
|
|
|
|
|
%.o : %.c Makefile
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $<
|
|
|
|
|
|
|
|
clean:
|
|
|
|
-rm -f *.o
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|