29 lines
700 B
Makefile
29 lines
700 B
Makefile
|
SRC = $(wildcard $(SRCROOT)/Window/*.cpp $(SRCROOT)/Window/Linux/*.cpp)
|
||
|
OBJ = $(SRC:.cpp=.o)
|
||
|
|
||
|
LIB = libsfml-window.so
|
||
|
LIBNAME = $(LIB).$(VERSION)
|
||
|
FULLLIBNAME = $(LIBPATH)/$(LIBNAME)
|
||
|
LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB)
|
||
|
|
||
|
all: $(LIB)
|
||
|
|
||
|
libsfml-window.so: $(OBJ)
|
||
|
$(CPP) $(LDFLAGS) -Wl,-soname,$(LIBNAME) -o $(FULLLIBNAME) $(OBJ) -lX11 -lXrandr -lGL
|
||
|
|
||
|
$(OBJ): %.o: %.cpp
|
||
|
$(CPP) -o $@ -c $< $(CFLAGS)
|
||
|
|
||
|
.PHONY: clean mrproper
|
||
|
|
||
|
clean:
|
||
|
rm -rf $(OBJ)
|
||
|
|
||
|
mrproper: clean
|
||
|
rm -rf $(FULLLIBNAME)
|
||
|
|
||
|
install:
|
||
|
objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME)
|
||
|
objcopy --strip-unneeded $(FULLLIBNAME) $(DESTLIBDIR)/$(LIBNAME)
|
||
|
$(LINK)
|