2012-11-03 01:16:01 +00:00
|
|
|
DEFINES=
|
|
|
|
CC=gcc
|
|
|
|
CXX=g++
|
|
|
|
LD=g++
|
|
|
|
PROFILE=
|
2019-01-24 12:31:07 +00:00
|
|
|
PKGCONFIG := $(CROSS)pkg-config
|
|
|
|
|
|
|
|
# Distros could use different names for the crypto library. We try a list
|
|
|
|
# of candidate names, only one of them should be the valid one.
|
|
|
|
LIBCRYPTO_NAMES = libcryptopp libcrypto++ cryptopp crypto++
|
|
|
|
|
|
|
|
$(foreach l,$(LIBCRYPTO_NAMES),\
|
|
|
|
$(eval LDOPTS += $(shell $(PKGCONFIG) --silence-errors --libs $(l))))
|
|
|
|
$(foreach l,$(LIBCRYPTO_NAMES),\
|
|
|
|
$(eval CFLAGS += $(shell $(PKGCONFIG) --silence-errors --cflags $(l))))
|
|
|
|
$(foreach l,$(LIBCRYPTO_NAMES),\
|
|
|
|
$(eval CXXFLAGS += $(shell $(PKGCONFIG) --silence-errors --cflags $(l))))
|
|
|
|
|
|
|
|
CXXFLAGS=-g $(PROFILE) -Wall $(DEFINES)
|
|
|
|
CFLAGS=-g $(PROFILE) -Wall -std=c99 $(DEFINES)
|
|
|
|
LDFLAGS=$(PROFILE) $(LDOPTS) -lpthread
|
|
|
|
|
2012-11-03 01:16:01 +00:00
|
|
|
BINS=upgtool
|
|
|
|
|
|
|
|
all: $(BINS)
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
%.o: %.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
|
2020-06-13 14:21:16 +00:00
|
|
|
upgtool: upgtool.o upg.o misc.o mg.o keysig_search.o md5.o
|
2012-11-03 01:16:01 +00:00
|
|
|
$(LD) -o $@ $^ $(LDFLAGS)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -fr *.o
|
|
|
|
|
|
|
|
veryclean:
|
|
|
|
rm -rf $(BINS)
|