I did not you guys where having some fun. I am sorry to arrive late. I guess I need a lot to learn to catch up.
@Colibri.DVB Thanks, keep this type of project going on. I love to learn form all of you masters. My admiration to all of you coders.
I know there is a lot of good coders that made to here but my cudos to @JimBizkit for the nice source code.
To the guys that are having trouble with Windows, like @harshy & @hoffmann . It works it just that we need to learn the differences from gnu linux to windows. Small issues do not worry.
I use "TDM-GCC", but you can use any GNU.
Makefile has to be adjusted:
Code:
poc is not recognized as an internal or external command
This happens because your line 29 should read "BIN = poc.exe"
Code:
poc.c:947:5: error: 'for' loop initial declarations are only allowed in C99 mode
poc.c:947:5: note: use option -std=c99 or -std=gnu99 to compile your code
poc.c:968:7: error: 'for' loop initial declarations are only allowed in C99 mode
Makefile:36: recipe for target `poc.o' failed
make: *** [poc.o] Error 1
The answer is on the message, your line 22 should read:
"CC_WARN=-W -Wall -Wshadow -Wredundant-decls -std=c99"
Now if after removing the errors you still can not have a working out.ts
I found that in my case the optimization flag "-o3" is causing issues. You can try to compile with -02.
So at the end here is my working Makefile
Code:
UNAME := $(shell uname -s)
CC ?= gcc
STRIP ?= strip
TARGETHELP := $(shell $(CC) --target-help 2>&1)
CFLAGS=-I. -O2
ifneq (,$(findstring sse2,$(TARGETHELP)))
CFLAGS=-I. -O2 -funroll-loops -fomit-frame-pointer -mmmx -msse -msse2 -msse3
else ifneq (,$(findstring mplt,$(TARGETHELP)))
CFLAGS=-I. -O2 -funroll-loops -fomit-frame-pointer -mplt
else ifneq (,$(findstring m4-300,$(TARGETHELP)))
CFLAGS=-I. -O2 -fPIC -funroll-loops -fomit-frame-pointer -m4-300
else
CFLAGS=-I. -O2 -funroll-loops
endif
LFLAGS=-lpthread
#LFLAGS=-L. -lpthread -ldvbcsa
CC_WARN=-W -Wall -Wshadow -Wredundant-decls -std=c99
SRCS = cscrypt/des.c ffdecsa/ffdecsa.c poc.c
Q = @
SAY = @echo
OBJS = $(SRCS:.c=.o)
DEPS = $(SRCS:.c=.d)
BIN = poc.exe
all: poc
-include $(OBJS:.o=.d)
%.o: %.c
$(Q)$(CC) $(CC_WARN) -c -o $@ $< $(CFLAGS)
$(SAY) "CC $<"
$(Q)$(CC) $(CC_WARN) -MM $(CFLAGS) $*.c > $*.d
poc: $(OBJS)
$(Q)$(CC) $(CC_WARN) -o $(BIN) $(OBJS) $(CFLAGS) $(LFLAGS)
$(STRIP) $(BIN)
clean:
rm -rf $(BIN) $(OBJS) $(DEPS) out.ts
.PHONY: poc
So try it, it works. Now I need to learn the basics from you masters.