summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile38
-rw-r--r--src/econvert.c2
-rw-r--r--src/gp.c8
-rw-r--r--src/gp.h14
-rw-r--r--src/gp/gp.gp4
5 files changed, 14 insertions, 52 deletions
diff --git a/src/Makefile b/src/Makefile
index 3d51fbf..be6bdb9 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -6,14 +6,10 @@
####
CC ?= gcc
-GP2C = gp2c
CFLAGS = -O3 -Wall
LDFLAGS = -L../lib/parson -L../lib/sha1
-GP_CFLAGS = -O3 -Wall -fomit-frame-pointer -fno-strict-aliasing -fPIC
-GPFLAGS = -g -i4
-
INCLUDES = -I. -I../lib
LIBS = -lrt -lpari -lparson
@@ -21,45 +17,37 @@ LIBS = -lrt -lpari -lparson
VPATH = cm:invalid:io:exhaustive:math
-GP =
-GPC = $(addsuffix .c, $(GP))
-GPO = $(addsuffix .o, $(GP))
-GPH = $(addsuffix .h, $(GP))
+ECGEN_SRC = ecgen.c $(wildcard */*.c)
+ECGEN_OBJ = $(patsubst %.c,%.o, $(ECGEN_SRC))
+
+ECONVERT_SRC = econvert.c $(wildcard */*.c)
+ECONVERT_OBJ = $(patsubst %.c,%.o, $(ECONVERT_SRC))
-SRC = ecgen.c $(wildcard */*.c)
-OBJ = $(patsubst %.c,%.o, $(SRC))
-HDR = $(wildcard *.h) $(wildcard */*.h)
+SRC = $(ECGEN_SRC) $(ECONVERT_SRC)
+HDR = $(wildcard */*.h)
####
all: ecgen
-ecgen: ecgen.o $(GPO) $(OBJ)
+ecgen: ecgen.o $(ECGEN_OBJ)
$(CC) $(CFLAGS) $(INCLUDES) -o $@ $^ $(LDFLAGS) $(LIBS)
mv ecgen ..
-gp2c: $(GPC) $(GPH)
-
-$(GPO): $(GPC) $(GPH)
- $(CC) $(GP_CFLAGS) $(INCLUDES) -c -o $@ $< $(LDFLAGS) $(LIBS)
+econvert: econvert.o $(ECONVERT_OBJ)
+ $(CC) $(CFLAGS) $(INCLUDES) -o $@ $^ $(LDFLAGS) $(LIBS)
+ mv econvert ..
-%.o: %.c $(GPH)
+%.o: %.c
$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
-%.h %.c: %.gp
- $(GP2C) $(GPFLAGS) gp/$*.gp 2>/dev/null | clang-format | awk 'BEGIN{print "#ifndef GP_H" > "gp.h"; print "#define GP_H" >> "gp.h";} { if(found) print >> "gp.c"; else print >> "gp.h"} /End of prototype/{found=1; print "#include \"gp.h\"" > "gp.c"; print "#endif //GP_H" >> "gp.h"}'
-
####
-clean-all: clean clean-gp
+clean-all: clean
clean:
find . -type f -name '*.o' -exec rm {} +
-clean-gp:
- rm -f $(GPH)
- rm -f $(GPC)
-
format:
clang-format -i $(SRC)
clang-format -i $(HDR)
diff --git a/src/econvert.c b/src/econvert.c
index 6c53887..b9b9af5 100644
--- a/src/econvert.c
+++ b/src/econvert.c
@@ -24,4 +24,4 @@
* @copyright GPL v2.0
*/
-int main(void) {}
+int main(void) { return 0; }
diff --git a/src/gp.c b/src/gp.c
deleted file mode 100644
index 59cb11a..0000000
--- a/src/gp.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "gp.h"
-
-void init_gp(void) /* void */
-{
- pari_sp ltop = avma;
- avma = ltop;
- return;
-}
diff --git a/src/gp.h b/src/gp.h
deleted file mode 100644
index 27e4726..0000000
--- a/src/gp.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef GP_H
-#define GP_H
-/*-*- compile-command: "cc -c -o gp/gp.gp.o -g -O3 -Wall -fomit-frame-pointer
- * -fno-strict-aliasing -fPIC -I"/usr/include/x86_64-linux-gnu" gp/gp.gp.c && cc
- * -o gp/gp.gp.so -shared -g -O3 -Wall -fomit-frame-pointer -fno-strict-aliasing
- * -fPIC -Wl,-shared -Wl,-z,relro gp/gp.gp.o -lc -lm -L/usr/lib/x86_64-linux-gnu
- * -lpari"; -*-*/
-#include <pari/pari.h>
-/*
-GP;install("init_gp","v","init_gp","./gp/gp.gp.so");
-*/
-void init_gp(void);
-/*End of prototype*/
-#endif // GP_H
diff --git a/src/gp/gp.gp b/src/gp/gp.gp
deleted file mode 100644
index 7fa5fd0..0000000
--- a/src/gp/gp.gp
+++ /dev/null
@@ -1,4 +0,0 @@
-/*
- * ecgen, tool for generating Elliptic curve domain parameters
- * Copyright (C) 2017 J08nY
- */