-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (41 loc) · 1.04 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
47
48
49
50
51
52
53
LINK.o = $(LINK.cc)
CXXFLAGS = -std=c++17 -g -Wall -Wno-sign-compare
CCFLAGS = -g
LINK_OBJS = link.o sn.o mapped_file.o omf.o expr.o set_file_type.o afp/libafp.a
NM_OBJS = nm.o sn.o mapped_file.o
# static link if using mingw32 or mingw64 to make redistribution easier.
# also add mingw directory.
ifeq ($(MSYSTEM),MINGW32)
LINK_OBJS += mingw/err.o
NM_OBJS += mingw/err.o
CPPFLAGS += -I mingw/
LDLIBS += -static
endif
ifeq ($(MSYSTEM),MINGW64)
LINK_OBJS += mingw/err.o
NM_OBJS += mingw/err.o
CPPFLAGS += -I mingw/
LDLIBS += -static
endif
.PHONY: all
all: sn-link sn-nm
.PHONY: clean
clean:
$(RM) sn-link sn-nm $(LINK_OBJS) $(NM_OBJS)
$(MAKE) -C afp clean
sn-link: $(LINK_OBJS)
$(LINK.o) $^ $(LDLIBS) -o $@
sn-nm: $(NM_OBJS)
$(LINK.o) $^ $(LDLIBS) -o $@
.PHONY: subdirs
subdirs :
$(MAKE) -C afp
afp/libafp.a : subdirs
set_file_type.o : CPPFLAGS += -I afp/include
set_file_type.o : set_file_type.cpp
link.o : link.cpp sn.h
nm.o : nm.cpp sn.h
expr.o : expr.cpp sn.h
omf.o : omf.cpp omf.h
sn.o : sn.cpp sn.h
mingw/err.o : mingw/err.c mingw/err.h