mirror of
https://github.com/allankoechke/jwt-cpp.git
synced 2026-12-05 01:12:56 +00:00
Added support for openssl 1.1. Removed gtest src dependencies
This commit is contained in:
57
Makefile
Normal file
57
Makefile
Normal file
@@ -0,0 +1,57 @@
|
||||
SRC = $(shell find . -name '*.cpp') $(shell find . -name '*.c')
|
||||
HEADERS = $(shell find . -name '*.h')
|
||||
EXCLUDE_SRC =
|
||||
FSRC = $(filter-out $(EXCLUDE_SRC), $(SRC))
|
||||
OBJ = $(FSRC:=.o)
|
||||
|
||||
DEP_DIR = .deps
|
||||
|
||||
FLAGS = -fPIC -Wall -Wno-unknown-pragmas -I include
|
||||
CXXFLAGS =
|
||||
CFLAGS =
|
||||
LINKFLAGS = -lssl -lcrypto -lgtest
|
||||
|
||||
OUTFILE = test
|
||||
|
||||
.PHONY: clean debug release
|
||||
|
||||
all: debug
|
||||
|
||||
debug: FLAGS += -g
|
||||
debug: $(OUTFILE)
|
||||
|
||||
release: FLAGS += -O2 -march=native
|
||||
release: $(OUTFILE)
|
||||
|
||||
$(OUTFILE): $(OBJ)
|
||||
@echo Generating binary
|
||||
@$(CXX) -o $@ $^ $(LINKFLAGS)
|
||||
@echo Build done
|
||||
|
||||
%.cc.o: %.cc
|
||||
@echo Building $<
|
||||
@$(CXX) -c $(FLAGS) $(CXXFLAGS) $< -o $@
|
||||
@mkdir -p `dirname $(DEP_DIR)/$@.d`
|
||||
@$(CXX) -c $(FLAGS) $(CXXFLAGS) -MT '$@' -MM $< > $(DEP_DIR)/$@.d
|
||||
|
||||
%.cpp.o: %.cpp
|
||||
@echo Building $<
|
||||
@$(CXX) -c $(FLAGS) $(CXXFLAGS) $< -o $@
|
||||
@mkdir -p `dirname $(DEP_DIR)/$@.d`
|
||||
@$(CXX) -c $(FLAGS) $(CXXFLAGS) -MT '$@' -MM $< > $(DEP_DIR)/$@.d
|
||||
|
||||
%.c.o: %.c
|
||||
@echo Building $<
|
||||
@$(CC) -c $(FLAGS) $(CFLAGS) $< -o $@
|
||||
@mkdir -p `dirname $(DEP_DIR)/$@.d`
|
||||
@$(CC) -c $(FLAGS) $(CFLAGS) -MT '$@' -MM $< > $(DEP_DIR)/$@.d
|
||||
|
||||
clean:
|
||||
@echo Removing binary
|
||||
@rm -f $(OUTFILE)
|
||||
@echo Removing objects
|
||||
@rm -f $(OBJ)
|
||||
@echo Removing dependency files
|
||||
@rm -rf $(DEP_DIR)
|
||||
|
||||
-include $(OBJ:%=$(DEP_DIR)/%.d)
|
||||
Reference in New Issue
Block a user