1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- INC_PATH = inc
- SRC_PATH = src
- OBJ_PATH = obj
- BIN_PATH = bin
- PRSONA_PATH = .
- PRSONA_INC_PATH = $(PRSONA_PATH)/$(INC_PATH)
- PRSONA_SRC_PATH = $(PRSONA_PATH)/$(SRC_PATH)
- PRSONA_OBJ_PATH = $(PRSONA_PATH)/$(OBJ_PATH)
- PRSONA_BIN_PATH = $(PRSONA_PATH)/$(BIN_PATH)
- BGN_PATH = ../BGN2/bgn2
- BGN_INC_PATH = $(BGN_PATH)/$(INC_PATH)
- BGN_SRC_PATH = $(BGN_PATH)/$(SRC_PATH)
- BGN_OBJ_PATH = $(BGN_PATH)/$(OBJ_PATH)
- BGN_BIN_PATH = $(BGN_PATH)/$(BIN_PATH)
- 666_PATH = ../BGN2/dclxvi-20130329
- 666_INC_PATH = $(666_PATH)/$(INC_PATH)
- 666_SRC_PATH = $(666_PATH)/$(SRC_PATH)
- 666_OBJ_PATH = $(666_PATH)/$(OBJ_PATH)
- 666_BIN_PATH = $(666_PATH)/$(BIN_PATH)
- CPP = g++
- CPPFLAGS = -std=c++14 -Wall -I$(PRSONA_INC_PATH) -I$(BGN_INC_PATH) -I$(666_INC_PATH) -O2
- LDFLAGS = -lgmp -lgmpxx
- CC = gcc
- CFLAGS = -std=c99 -O3 -fomit-frame-pointer -I$(666_INC_PATH)
- C_LDFLAGS = -lm
- all: $(PRSONA_BIN_PATH) $(PRSONA_OBJ_PATH) $(BGN_OBJ_PATH) $(666_OBJ_PATH) $(PRSONA_BIN_PATH)/main
- $(PRSONA_BIN_PATH):
- mkdir -p $@
- $(PRSONA_OBJ_PATH):
- mkdir -p $@
- $(BGN_OBJ_PATH):
- mkdir -p $@
- $(666_OBJ_PATH):
- mkdir -p $@
- PRSONA_FULL_SRC = $(wildcard $(PRSONA_SRC_PATH)/*.cpp)
- PRSONA_SRC = $(filter-out $(PRSONA_SRC_PATH)/main.cpp, $(PRSONA_FULL_SRC))
- PRSONA_OBJ = $(patsubst $(PRSONA_SRC_PATH)/%.cpp, $(PRSONA_OBJ_PATH)/%.o, $(PRSONA_SRC))
- $(PRSONA_OBJ_PATH)/%.o: $(PRSONA_SRC_PATH)/%.cpp
- $(CPP) $(CPPFLAGS) -DQHASM -c -o $@ $<
- BGN_FULL_SRC = $(wildcard $(BGN_SRC_PATH)/*.cpp)
- BGN_SRC = $(filter-out $(BGN_SRC_PATH)/main.cpp, $(BGN_FULL_SRC))
- BGN_OBJ = $(patsubst $(BGN_SRC_PATH)/%.cpp, $(BGN_OBJ_PATH)/%.o, $(BGN_SRC))
- $(BGN_OBJ_PATH)/%.o: $(BGN_SRC_PATH)/%.cpp
- $(CPP) $(CPPFLAGS) -DQHASM -c -o $@ $<
- 666_ALL_C_SRC = $(wildcard $(666_SRC_PATH)/*.c)
- 666_C_SRC = $(filter-out $(666_SRC_PATH)/bilintest.c $(666_SRC_PATH)/speedtest.c $(666_SRC_PATH)/test_curvepoint_multiscalar.c $(666_SRC_PATH)/test_twistpoint_multiscalar.c $(666_SRC_PATH)/twistpoint_fp2_multiscalar.c $(666_SRC_PATH)/curvepoint_fp_multiscalar.c, $(666_ALL_C_SRC))
- 666_C_OBJ = $(patsubst $(666_SRC_PATH)/%.c, $(666_OBJ_PATH)/%_c_with_as.o, $(666_C_SRC))
- $(666_OBJ_PATH)/%_c_with_as.o: $(666_SRC_PATH)/%.c $(666_INC_PATH)/%.h
- $(CC) $(CFLAGS) -DQHASM -c -o $@ $<
- 666_AS_SRC = $(wildcard $(666_SRC_PATH)/*.s)
- 666_AS_OBJ = $(patsubst $(666_SRC_PATH)/%.s, $(666_OBJ_PATH)/%_as.o, $(666_AS_SRC))
- $(666_OBJ_PATH)/%_as.o: $(666_SRC_PATH)/%.s
- $(CC) $(CFLAGS) -fPIC -c -o $@ $^
- $(BGN_OBJ_PATH)/bgn.a: $(BGN_OBJ) $(666_AS_OBJ) $(666_C_OBJ)
- rm -f $@
- ar cr $@ $^
- $(PRSONA_BIN_PATH)/main: $(PRSONA_OBJ_PATH)/main.o $(PRSONA_OBJ) $(BGN_OBJ_PATH)/bgn.a
- $(CPP) $(CPPFLAGS) -no-pie -o $@ $^ $(LDFLAGS)
- .PHONY: clean
- clean: prsona_clean bgn_clean 666_clean
- prsona_clean:
- -rm $(PRSONA_BIN_PATH)/*
- -rm $(PRSONA_OBJ_PATH)/*
- bgn_clean:
- -rm $(BGN_OBJ_PATH)/*
- 666_clean:
- -rm $(666_OBJ_PATH)/*
|