aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorJ08nY2017-04-05 12:46:14 +0200
committerJ08nY2017-04-05 12:46:14 +0200
commit2bcb800524eff712bf9c0789be90a5798e322b6d (patch)
tree6eaaada90da519154a6ffa55846b52051625381a /src/Makefile
parentf25a2b7bfed27160173ae62e8552f27e8c59ee58 (diff)
downloadecgen-2bcb800524eff712bf9c0789be90a5798e322b6d.tar.gz
ecgen-2bcb800524eff712bf9c0789be90a5798e322b6d.tar.zst
ecgen-2bcb800524eff712bf9c0789be90a5798e322b6d.zip
Removed GP compilation, added econvert target
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile38
1 files changed, 13 insertions, 25 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)