2023-08-08 20:11:33 +02:00
|
|
|
BINDIR ?= /bin
|
|
|
|
MANDIR ?= /share/man
|
2021-07-03 21:57:53 +02:00
|
|
|
|
2023-01-08 21:05:04 +01:00
|
|
|
TARGET_BINARIES=acsmdownloader adept_activate adept_remove adept_loan_mgt
|
|
|
|
TARGETS=$(TARGET_BINARIES) launcher
|
2021-07-03 21:57:53 +02:00
|
|
|
|
2023-01-10 21:03:45 +01:00
|
|
|
MAN_PAGES=acsmdownloader adept_activate adept_remove adept_loan_mgt
|
|
|
|
|
2023-01-15 09:51:00 +01:00
|
|
|
CXXFLAGS=-Wall -fPIC -I$(ROOT)/include
|
2021-09-28 18:14:41 +02:00
|
|
|
|
2021-11-26 20:01:21 +01:00
|
|
|
STATIC_DEP=
|
2023-01-08 21:12:38 +01:00
|
|
|
LDFLAGS += -L$(ROOT) -lcrypto -lzip -lz -lcurl -lpugixml
|
2024-09-19 08:43:23 +02:00
|
|
|
LDFLAGS += -L$(ROOT) $(ROOT)/lib/openssl/libcrypto.a -lzip -lz -lcurl -lpugixml
|
2021-11-26 20:01:21 +01:00
|
|
|
|
2021-07-05 20:23:25 +02:00
|
|
|
ifneq ($(STATIC_UTILS),)
|
2021-11-26 20:01:21 +01:00
|
|
|
STATIC_DEP = $(ROOT)/libgourou.a
|
2021-07-05 20:23:25 +02:00
|
|
|
else
|
2021-09-28 15:02:50 +02:00
|
|
|
LDFLAGS += -lgourou
|
2021-07-05 20:23:25 +02:00
|
|
|
endif
|
2021-07-03 21:57:53 +02:00
|
|
|
|
|
|
|
ifneq ($(DEBUG),)
|
2022-08-07 16:45:12 +02:00
|
|
|
CXXFLAGS += -ggdb -O0 -DDEBUG
|
2021-07-03 21:57:53 +02:00
|
|
|
else
|
|
|
|
CXXFLAGS += -O2
|
|
|
|
endif
|
|
|
|
|
2022-06-08 11:39:05 +02:00
|
|
|
|
2022-04-03 09:36:23 +02:00
|
|
|
COMMON_DEPS = drmprocessorclientimpl.cpp utils_common.cpp
|
|
|
|
COMMON_OBJECTS = $(COMMON_DEPS:.cpp=.o)
|
|
|
|
COMMON_LIB = utils.a
|
2021-12-18 17:42:23 +01:00
|
|
|
|
2021-07-03 21:57:53 +02:00
|
|
|
all: $(TARGETS)
|
|
|
|
|
2023-01-14 12:56:06 +01:00
|
|
|
${COMMON_LIB}: $(COMMON_DEPS)
|
|
|
|
$(CXX) $(CXXFLAGS) $(COMMON_DEPS) $(LDFLAGS) -c
|
|
|
|
$(AR) crs $@ $(COMMON_OBJECTS)
|
2022-04-03 09:36:23 +02:00
|
|
|
|
2023-01-14 12:56:06 +01:00
|
|
|
%: %.cpp $(COMMON_LIB) $(STATIC_DEP)
|
|
|
|
$(CXX) $(CXXFLAGS) $^ $(STATIC_DEP) $(LDFLAGS) -o $@
|
2021-07-03 21:57:53 +02:00
|
|
|
|
2023-01-10 21:03:45 +01:00
|
|
|
install: $(TARGET_BINARIES)
|
|
|
|
install -d $(DESTDIR)$(PREFIX)/$(BINDIR)
|
|
|
|
install -m 755 $(TARGET_BINARIES) $(DESTDIR)$(PREFIX)/$(BINDIR)
|
|
|
|
install -d $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
|
|
|
|
install -m 644 man/*.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
|
2023-01-08 21:05:04 +01:00
|
|
|
|
|
|
|
uninstall:
|
2023-01-10 21:03:45 +01:00
|
|
|
cd $(DESTDIR)$(PREFIX)/$(BINDIR)
|
2023-01-08 21:05:04 +01:00
|
|
|
rm -f $(TARGET_BINARIES)
|
|
|
|
cd -
|
2023-01-10 21:03:45 +01:00
|
|
|
cd $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
|
|
|
|
rm -f $(addsuffix .1,$(TARGET_BINARIES)
|
2023-01-08 21:05:04 +01:00
|
|
|
|
2021-07-03 21:57:53 +02:00
|
|
|
clean:
|
2022-08-27 15:44:27 +02:00
|
|
|
rm -f $(TARGETS) $(COMMON_LIB)
|
2021-07-03 21:57:53 +02:00
|
|
|
|
|
|
|
ultraclean: clean
|