1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-21 18:25:41 +03:00
aports/testing/openv2g/makefiles.patch
Olliver Schinagl 636de66f4e testing/openv2g: New aport
OpenV2G is an open source implementation of the ISO IEC 15118 and also
the DIN 70121 vehicle to grid (V2G) communication interface.

The main component are the libraries, but the repository also includes a
testing application.

The makefile(s) are a bit of a mess, and should be rewritten. However as
that is outside of the scope, only the most minimal changes where done
to produce a useable build.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2019-11-21 21:25:55 +01:00

192 lines
9.7 KiB
Diff

diff --git a/Release/makefile b/Release/makefile
index f30e46e..2cd455f 100644
--- a/Release/makefile
+++ b/Release/makefile
@@ -5,6 +5,7 @@
-include ../makefile.init
RM := rm -rf
+DESTDIR := '/usr/local'
# All of the sources participating in the build are defined here
-include sources.mk
@@ -30,19 +31,62 @@ endif
# Add inputs and outputs from these tool invocations to the build variables
# All Target
-all: OpenV2G.exe
+all: OpenV2G
# Tool invocations
-OpenV2G.exe: $(OBJS) $(USER_OBJS)
+OpenV2G: $(BIN_OBJS) $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: MinGW C Linker'
- gcc -o "OpenV2G.exe" $(OBJS) $(USER_OBJS) $(LIBS)
+ @echo 'objs: $(OBJS) userobjs: $(USER_OBJS) libs: $(LIBS)'
+ ar rcs 'libopenv2g.a' $(OBJS) $(USER_OBJS)
+ gcc -shared -o 'libopenv2g.so' $(OBJS) $(USER_OBJS) $(LIBS)
+ gcc -o 'openv2g' $(BIN_OBJS) $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
+install: all
+ @install -D -m 755 -t '$(DESTDIR)/bin' 'openv2g'
+ @install -D -m 644 'libopenv2g.so' '$(DESTDIR)/lib/libopenv2g.so.0.9.4'
+ @ln -s 'libopenv2g.so.0.9.4' '$(DESTDIR)/lib/libopenv2g.so.0'
+ @ln -s 'libopenv2g.so.0' '$(DESTDIR)/lib/libopenv2g.so'
+ @install -D -m 644 -t '$(DESTDIR)/lib' 'libopenv2g.a'
+ @install -D -m 644 -t '$(DESTDIR)/include/openv2g/appHandshake' \
+ ../src/appHandshake/appHandEXIDatatypes.h \
+ ../src/appHandshake/appHandEXIDatatypesDecoder.h \
+ ../src/appHandshake/appHandEXIDatatypesEncoder.h
+ @install -D -m 644 -t '$(DESTDIR)/include/openv2g/codec' \
+ ../src/codec/BitInputStream.h \
+ ../src/codec/BitOutputStream.h \
+ ../src/codec/ByteStream.h \
+ ../src/codec/DecoderChannel.h \
+ ../src/codec/EXIConfig.h \
+ ../src/codec/EXIHeaderDecoder.h \
+ ../src/codec/EXIHeaderEncoder.h \
+ ../src/codec/EXIOptions.h \
+ ../src/codec/EXITypes.h \
+ ../src/codec/EncoderChannel.h \
+ ../src/codec/ErrorCodes.h \
+ ../src/codec/MethodsBag.h
+ @install -D -m 644 -t '$(DESTDIR)/include/openv2g/din' \
+ ../src/din/dinEXIDatatypes.h \
+ ../src/din/dinEXIDatatypesDecoder.h \
+ ../src/din/dinEXIDatatypesEncoder.h \
+ ../src/iso1/iso1EXIDatatypes.h \
+ ../src/iso1/iso1EXIDatatypesDecoder.h \
+ ../src/iso1/iso1EXIDatatypesEncoder.h \
+ ../src/iso2/iso2EXIDatatypes.h \
+ ../src/iso2/iso2EXIDatatypesDecoder.h \
+ ../src/iso2/iso2EXIDatatypesEncoder.h
+ @install -D -m 644 -t '$(DESTDIR)/include/openv2g/transport' \
+ ../src/transport/v2gtp.h
+ @install -D -m 644 -t '$(DESTDIR)/include/openv2g/xmldsig' \
+ ../src/xmldsig/xmldsigEXIDatatypes.h \
+ ../src/xmldsig/xmldsigEXIDatatypesDecoder.h \
+ ../src/xmldsig/xmldsigEXIDatatypesEncoder.h
+
# Other Targets
clean:
- -$(RM) $(EXECUTABLES)$(OBJS)$(C_DEPS) OpenV2G.exe
+ -$(RM) $(EXECUTABLES)$(OBJS)$(C_DEPS) openv2g libopenv2g.a libopenv2g.so
-@echo ' '
.PHONY: all clean dependents
diff --git a/Release/src/appHandshake/subdir.mk b/Release/src/appHandshake/subdir.mk
index 9181dcc..cd8e5a3 100644
--- a/Release/src/appHandshake/subdir.mk
+++ b/Release/src/appHandshake/subdir.mk
@@ -23,7 +23,7 @@ C_DEPS += \
src/appHandshake/%.o: ../src/appHandshake/%.c
@echo 'Building file: $<'
@echo 'Invoking: GCC C Compiler'
- gcc -I"../src/codec" -I"../src/din" -I"../src/iso1" -I"../src/iso2" -I"../src/xmldsig" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
+ gcc -I"../src/codec" -I"../src/din" -I"../src/iso1" -I"../src/iso2" -I"../src/xmldsig" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -fPIC -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
diff --git a/Release/src/codec/subdir.mk b/Release/src/codec/subdir.mk
index ecedb18..d1647bf 100644
--- a/Release/src/codec/subdir.mk
+++ b/Release/src/codec/subdir.mk
@@ -38,7 +38,7 @@ C_DEPS += \
src/codec/%.o: ../src/codec/%.c
@echo 'Building file: $<'
@echo 'Invoking: GCC C Compiler'
- gcc -I"../src/codec" -I"../src/din" -I"../src/iso1" -I"../src/iso2" -I"../src/xmldsig" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
+ gcc -I"../src/codec" -I"../src/din" -I"../src/iso1" -I"../src/iso2" -I"../src/xmldsig" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -fPIC -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
diff --git a/Release/src/din/subdir.mk b/Release/src/din/subdir.mk
index 209e552..773d4ce 100644
--- a/Release/src/din/subdir.mk
+++ b/Release/src/din/subdir.mk
@@ -23,7 +23,7 @@ C_DEPS += \
src/din/%.o: ../src/din/%.c
@echo 'Building file: $<'
@echo 'Invoking: GCC C Compiler'
- gcc -I"../src/codec" -I"../src/din" -I"../src/iso1" -I"../src/iso2" -I"../src/xmldsig" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
+ gcc -I"../src/codec" -I"../src/din" -I"../src/iso1" -I"../src/iso2" -I"../src/xmldsig" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -fPIC -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
diff --git a/Release/src/iso1/subdir.mk b/Release/src/iso1/subdir.mk
index d8ea6ae..7920ac8 100644
--- a/Release/src/iso1/subdir.mk
+++ b/Release/src/iso1/subdir.mk
@@ -23,7 +23,7 @@ C_DEPS += \
src/iso1/%.o: ../src/iso1/%.c
@echo 'Building file: $<'
@echo 'Invoking: GCC C Compiler'
- gcc -I"../src/codec" -I"../src/din" -I"../src/iso1" -I"../src/iso2" -I"../src/xmldsig" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
+ gcc -I"../src/codec" -I"../src/din" -I"../src/iso1" -I"../src/iso2" -I"../src/xmldsig" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -fPIC -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
diff --git a/Release/src/iso2/subdir.mk b/Release/src/iso2/subdir.mk
index caf3b79..de3ba35 100644
--- a/Release/src/iso2/subdir.mk
+++ b/Release/src/iso2/subdir.mk
@@ -23,7 +23,7 @@ C_DEPS += \
src/iso2/%.o: ../src/iso2/%.c
@echo 'Building file: $<'
@echo 'Invoking: GCC C Compiler'
- gcc -I"../src/codec" -I"../src/din" -I"../src/iso1" -I"../src/iso2" -I"../src/xmldsig" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
+ gcc -I"../src/codec" -I"../src/din" -I"../src/iso1" -I"../src/iso2" -I"../src/xmldsig" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -fPIC -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
diff --git a/Release/src/test/subdir.mk b/Release/src/test/subdir.mk
index eceb3be..9f5db63 100644
--- a/Release/src/test/subdir.mk
+++ b/Release/src/test/subdir.mk
@@ -8,7 +8,7 @@ C_SRCS += \
../src/test/main_databinder.c \
../src/test/main_example.c
-OBJS += \
+BIN_OBJS += \
./src/test/main.o \
./src/test/main_databinder.o \
./src/test/main_example.o
@@ -23,7 +23,7 @@ C_DEPS += \
src/test/%.o: ../src/test/%.c
@echo 'Building file: $<'
@echo 'Invoking: GCC C Compiler'
- gcc -I"../src/codec" -I"../src/din" -I"../src/iso1" -I"../src/iso2" -I"../src/xmldsig" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
+ gcc -I"../src/codec" -I"../src/din" -I"../src/iso1" -I"../src/iso2" -I"../src/xmldsig" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -fPIC -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
diff --git a/Release/src/transport/subdir.mk b/Release/src/transport/subdir.mk
index fc10ca1..c4e8b99 100644
--- a/Release/src/transport/subdir.mk
+++ b/Release/src/transport/subdir.mk
@@ -17,7 +17,7 @@ C_DEPS += \
src/transport/%.o: ../src/transport/%.c
@echo 'Building file: $<'
@echo 'Invoking: GCC C Compiler'
- gcc -I"../src/codec" -I"../src/din" -I"../src/iso1" -I"../src/iso2" -I"../src/xmldsig" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
+ gcc -I"../src/codec" -I"../src/din" -I"../src/iso1" -I"../src/iso2" -I"../src/xmldsig" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -fPIC -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
diff --git a/Release/src/xmldsig/subdir.mk b/Release/src/xmldsig/subdir.mk
index 2497b78..20e799f 100644
--- a/Release/src/xmldsig/subdir.mk
+++ b/Release/src/xmldsig/subdir.mk
@@ -23,7 +23,7 @@ C_DEPS += \
src/xmldsig/%.o: ../src/xmldsig/%.c
@echo 'Building file: $<'
@echo 'Invoking: GCC C Compiler'
- gcc -I"../src/codec" -I"../src/din" -I"../src/iso1" -I"../src/iso2" -I"../src/xmldsig" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
+ gcc -I"../src/codec" -I"../src/din" -I"../src/iso1" -I"../src/iso2" -I"../src/xmldsig" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -fPIC -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '