46 lines
1.1 KiB
Makefile
46 lines
1.1 KiB
Makefile
TARGETS = passgen
|
|
BINARYOUT_TARGETS = passgen.o
|
|
|
|
CPPFLAGS += -I./include
|
|
CXXFLAGS += -std=c++20 -O2
|
|
|
|
|
|
ifeq ($(OS),Windows_NT)
|
|
CC = x86_64-w64-mingw32-g++
|
|
LD = x86_64-w64-mingw32-g++
|
|
EXE_EXT = .exe
|
|
INSTALL_DIR = /usr/local/bin # Change this to your desired installation directory
|
|
else
|
|
CC = g++
|
|
LD = g++
|
|
EXE_EXT =
|
|
INSTALL_DIR = /usr/local/bin # Change this to your desired installation directory
|
|
endif
|
|
|
|
all: $(TARGETS)$(EXE_EXT)
|
|
|
|
run:
|
|
./passgen$(EXE_EXT)
|
|
|
|
clean:
|
|
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
|
|
|
|
passgen.o: passgen.cpp ./include/pcg_random.hpp \
|
|
./include/pcg_extras.hpp ./include/pcg_uint128.hpp
|
|
$(CC) $(CPPFLAGS) $(CXXFLAGS) -c -o passgen.o passgen.cpp
|
|
|
|
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)"
|