-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdll1.mak
46 lines (32 loc) · 1.09 KB
/
dll1.mak
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
# build dll1.dll/dll1.o:
# make -f dll1.mak
# build lib_main_exp.a:
# dlltool -v -l lib_main_exp.a -d main_exp.def
SRC = dll1.c
#-----------------------------------------------------
# get <fn>.o from <fn>.c for sourceList
OBJ = $(patsubst %.c,%.o, $(notdir $(SRC)))
DEBUG = -g3 -O0
CPFLG = -fPIC $(DEBUG) -Wno-implicit-function-declaration
#CPFLG = -MMD $(DEBUG) -Wno-implicit-function-declaration
#CPFLG = $(DEBUG) -MMD -Wno-implicit-function-declaration
$(info - MAKE_HOST = $(MAKE_HOST))
#-----------------------------------------------------
ifeq "$(MAKE_HOST)" "x86_64-pc-linux-gnu"
LKFLG = $(DEBUG) -shared -export-dynamic
#-----------------------------------------------------
else
# MSYS: x86_64-pc-msys
LKFLG = -shared $(DEBUG) main.a
endif
#-----------------------------------------------------
build: $(OBJ)
@echo ================= $@ ========================
@echo "SRC=" $(SRC)
@echo "OBJ=" $(OBJ)
$(CC) $(OBJ) $(LKFLG) -o dll1.dll
#-----------------------------------------------------
.c.o:
@echo ================= Compile $@ ========================
$(CC) -c $(CPFLG) $<
# eof