-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
46 lines (34 loc) · 1.08 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
MAKEFLAGS = -j8
CFLAGS = -Wall -std=c99 -s -O2 -Wno-strict-aliasing -static
DLL = -shared
DIRS = -Idistorm3.2-package/include -Ibson
LIBS = -lws2_32 -lshlwapi
OBJDIR = objects
# Passes DBG=1 on as -DCUCKOODBG=1
ifdef DBG
CFLAGS += -DCUCKOODBG=$(DBG)
endif
ifneq ($(OS),Windows_NT)
CC = i686-w64-mingw32-gcc
else
CC = gcc
endif
DISTORM3 = $(wildcard distorm3.2-package/src/*.c)
DISTORM3OBJ = $(DISTORM3:distorm3.2-package/src/%.c=$(OBJDIR)/distorm3.2/%.o)
CUCKOOSRC = $(wildcard *.c)
CUCKOOOBJ = $(CUCKOOSRC:%.c=$(OBJDIR)/%.o)
BSONSRC = bson/bson.c bson/encoding.c bson/numbers.c
BSONOBJ = $(OBJDIR)/bson/bson.o $(OBJDIR)/bson/encoding.o $(OBJDIR)/bson/numbers.o
default: $(OBJDIR) cuckoomon.dll
$(OBJDIR):
mkdir $@ $@/bson $@/distorm3.2
$(OBJDIR)/distorm3.2/%.o: distorm3.2-package/src/%.c
$(CC) $(CFLAGS) $(DIRS) -c $^ -o $@
$(OBJDIR)/bson/%.o: bson/%.c
$(CC) $(CFLAGS) $(DIRS) -c $^ -o $@
$(OBJDIR)/%.o: %.c
$(CC) $(CFLAGS) $(DIRS) -c $^ -o $@
cuckoomon.dll: $(CUCKOOOBJ) $(DISTORM3OBJ) $(BSONOBJ)
$(CC) $(CFLAGS) $(DLL) $(DIRS) -o $@ $^ $(LIBS)
clean:
rm -rf $(OBJDIR) cuckoomon.dll