diff --git a/.gitignore b/.gitignore index 84a4fc6..3db44ff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ *.exe +*.o kpack_c *.code-workspace +*.bat diff --git a/Makefile b/Makefile index f87f5c1..b47bd12 100644 --- a/Makefile +++ b/Makefile @@ -1 +1,15 @@ -# TODO \ No newline at end of file +CFLAGS=-Wall -Wextra +LZMA_CFLAGS=-Wall -Wextra -O3 +all: kpack_c +kpack_c: kpack_c.o LZMAEncoder.o MatchFinder.o RangeCoder.o + gcc -o kpack_c kpack_c.o LZMAEncoder.o MatchFinder.o RangeCoder.o +kpack_c.o: kpack_c.c + gcc -c $(CFLAGS) -o kpack_c.o kpack_c.c +LZMAEncoder.o: lzma_c/LZMAEncoder.c lzma_c/LZMAEncoder.h lzma_c/MatchFinder.h lzma_c/lzma.h lzma_c/RangeCoder.h lzma_c/RangeCoderBit.h lzma_c/RangeCoderBitTree.h lzma_c/common.h + gcc -c $(LZMA_CFLAGS) -o LZMAEncoder.o lzma_c/LZMAEncoder.c +MatchFinder.o: lzma_c/MatchFinder.c lzma_c/MatchFinder.h lzma_c/common.h + gcc -c $(LZMA_CFLAGS) -o MatchFinder.o lzma_c/MatchFinder.c +RangeCoder.o: lzma_c/RangeCoder.c lzma_c/RangeCoder.h lzma_c/RangeCoderBit.h lzma_c/RangeCoderBitTree.h lzma_c/lzma.h lzma_c/common.h + gcc -c $(LZMA_CFLAGS) -o RangeCoder.o lzma_c/RangeCoder.c +clean: + rm -f *.o *.exe kpack_c diff --git a/kpack_c.c b/kpack_c.c new file mode 100644 index 0000000..f3d33d5 --- /dev/null +++ b/kpack_c.c @@ -0,0 +1,6 @@ +#include + +int main() +{ + printf("Abobaa!"); +} \ No newline at end of file diff --git a/lzma_c/common.h b/lzma_c/common.h index 16c1c0b..4db706e 100644 --- a/lzma_c/common.h +++ b/lzma_c/common.h @@ -1,18 +1,25 @@ #ifndef _COMMON_H #define _COMMON_H -typedef unsigned char byte; -typedef unsigned short word; -// conditional compiling, mike.dld -#ifdef WIN32 -typedef unsigned __int64 uint64; -#else -typedef unsigned long long uint64; -#define __stdcall __attribute__((stdcall)) -#endif -typedef byte bool; -#define true 1 -#define false 0 +#include +#include + +// typedef unsigned char byte; +// typedef unsigned short word; +// // conditional compiling, mike.dld +// #ifdef WIN32 +// typedef unsigned __int64 uint64; +// #else +// typedef unsigned long long uint64; +// #define __stdcall __attribute__((stdcall)) +// #endif +// typedef byte bool; +// #define true 1 +// #define false 0 + +typedef uint8_t byte; +typedef uint16_t word; +typedef uint64_t uint64; extern unsigned pack_length; extern unsigned pack_pos;