write makefile, fix lzma_c build
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
||||
*.exe
|
||||
*.o
|
||||
kpack_c
|
||||
*.code-workspace
|
||||
*.bat
|
||||
|
16
Makefile
16
Makefile
@@ -1 +1,15 @@
|
||||
# TODO
|
||||
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
|
||||
|
6
kpack_c.c
Normal file
6
kpack_c.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("Abobaa!");
|
||||
}
|
@@ -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 <stdint.h>
|
||||
#include <stdbool.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
|
||||
|
||||
typedef uint8_t byte;
|
||||
typedef uint16_t word;
|
||||
typedef uint64_t uint64;
|
||||
|
||||
extern unsigned pack_length;
|
||||
extern unsigned pack_pos;
|
||||
|
Reference in New Issue
Block a user