43 lines
973 B
Makefile
43 lines
973 B
Makefile
CFLAGS = -g -Wall
|
|
LDFLAGS = -L.
|
|
|
|
LIBVERSIONMAJOR = 0
|
|
LIBVERSIONMINOR = 0.1
|
|
|
|
OBJS = blocks.o \
|
|
frames.o \
|
|
memcard.o \
|
|
icon.o
|
|
|
|
.PHONY: clean lib-static static lib-shared shared qtdir
|
|
|
|
all: clean static
|
|
qt: clean lib-shared qtdir
|
|
|
|
qtdir:
|
|
make -C qt-test-cli clean all
|
|
|
|
clean:
|
|
rm -f *.o *.a *.so* $(OUTPUT)
|
|
|
|
lib-static: $(OBJS)
|
|
$(AR) rcs lib$(LIB).a $(OBJS)
|
|
|
|
lib-shared: $(OBJS)
|
|
ifeq ($(CC),g++)
|
|
$(LD) -shared -Wl,-soname,lib$(LIB).so.$(LIBVERSIONMAJOR) -o lib$(LIB).so.$(LIBVERSIONMAJOR).$(LIBVERSIONMINOR) $(OBJS)
|
|
ln -fs lib$(LIB).so.$(LIBVERSIONMAJOR).$(LIBVERSIONMINOR) lib$(LIB).so.$(LIBVERSIONMAJOR)
|
|
ln -fs lib$(LIB).so.$(LIBVERSIONMAJOR).$(LIBVERSIONMINOR) lib$(LIB).so
|
|
else
|
|
$(LD) -shared -Wl,-soname,lib$(LIB).so.$(LIBVERSIONMAJOR) -o lib$(LIB).dll $(OBJS)
|
|
endif
|
|
|
|
static: lib-static
|
|
$(LD) $(LDFLAGS) -static $(PROG).cpp -l$(LIB) -o $(OUTPUT)
|
|
|
|
shared: lib-shared $(PROG).o
|
|
$(LD) $(LDFLAGS) -l$(LIB) $(PROG).o -o $(OUTPUT)
|
|
|
|
%.o: %.cpp
|
|
$(CC) $(CFLAGS) -c $<
|
|
|