2024-04-28 11:03:20 +00:00
|
|
|
TARGETS = passgen
|
2024-04-28 11:53:52 +00:00
|
|
|
BINARYOUT_TARGETS = passgen.o
|
2024-04-28 10:01:50 +00:00
|
|
|
|
2024-04-28 11:03:20 +00:00
|
|
|
CPPFLAGS += -I./include
|
|
|
|
CXXFLAGS += -std=c++20 -O2
|
2024-04-28 10:01:50 +00:00
|
|
|
|
2024-04-28 11:53:52 +00:00
|
|
|
|
|
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
CC = x86_64-w64-mingw32-g++
|
|
|
|
LD = x86_64-w64-mingw32-g++
|
|
|
|
EXE_EXT = .exe
|
2024-04-28 15:07:47 +00:00
|
|
|
INSTALL_DIR = /usr/local/bin # Change this to your desired installation directory
|
2024-04-28 11:53:52 +00:00
|
|
|
else
|
|
|
|
CC = g++
|
|
|
|
LD = g++
|
|
|
|
EXE_EXT =
|
2024-04-28 15:07:47 +00:00
|
|
|
INSTALL_DIR = /usr/local/bin # Change this to your desired installation directory
|
2024-04-28 11:53:52 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
all: $(TARGETS)$(EXE_EXT)
|
|
|
|
|
|
|
|
run:
|
|
|
|
./passgen$(EXE_EXT)
|
2024-04-28 10:01:50 +00:00
|
|
|
|
|
|
|
clean:
|
2024-04-28 11:53:52 +00:00
|
|
|
rm -f *.o *.exe $(TARGETS) $(BINARYOUT_TARGETS)
|
|
|
|
|
|
|
|
passgen.exe: passgen.o
|
|
|
|
$(LD) -static-libgcc -static-libstdc++ passgen.o -o passgen.exe
|
|
|
|
|
|
|
|
passgen: passgen.o
|
|
|
|
$(LD) passgen.o -o passgen
|
2024-04-28 11:03:20 +00:00
|
|
|
|
|
|
|
passgen.o: passgen.cpp ./include/pcg_random.hpp \
|
|
|
|
./include/pcg_extras.hpp ./include/pcg_uint128.hpp
|
2024-04-28 11:53:52 +00:00
|
|
|
$(CC) $(CPPFLAGS) $(CXXFLAGS) -c -o passgen.o passgen.cpp
|
2024-04-28 15:07:47 +00:00
|
|
|
|
|
|
|
install: $(TARGETS)$(EXE_EXT)
|
|
|
|
@mkdir -p $(INSTALL_DIR)
|
|
|
|
cp $(TARGETS)$(EXE_EXT) $(INSTALL_DIR)
|
|
|
|
@echo "Installed $(TARGETS)$(EXE_EXT) to $(INSTALL_DIR)"
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
rm -f $(INSTALL_DIR)/$(TARGETS)$(EXE_EXT)
|
|
|
|
@echo "Uninstalled $(TARGETS)$(EXE_EXT) from $(INSTALL_DIR)"
|