wdc-utils/Makefile

51 lines
1.2 KiB
Makefile
Raw Normal View History

2016-12-26 16:03:06 +00:00
LINK.o = $(LINK.cc)
2017-01-11 19:28:18 +00:00
CXXFLAGS = -std=c++14 -g -Wall -Wno-sign-compare
2016-12-26 16:03:06 +00:00
CCFLAGS = -g
2017-01-08 03:19:28 +00:00
DUMP_OBJS = dumpobj.o disassembler.o zrdz_disassembler.o
2017-01-23 15:02:50 +00:00
LINK_OBJS = link.o expression.o omf.o set_file_type.o finder_info_helper.o
2016-12-26 16:03:06 +00:00
2017-03-11 16:48:21 +00:00
# static link if using mingw32 or mingw64 to make redistribution easier.
# also add mingw directory.
ifeq ($(MSYSTEM),MINGW32)
DUMP_OBJS += mingw/err.o
LINK_OBJS += mingw/err.o
CPPFLAGS += -I mingw/
LDLIBS += -static
endif
2016-12-26 16:03:06 +00:00
ifeq ($(MSYSTEM),MINGW64)
2017-01-08 03:19:28 +00:00
DUMP_OBJS += mingw/err.o
LINK_OBJS += mingw/err.o
2016-12-26 16:14:38 +00:00
CPPFLAGS += -I mingw/
LDLIBS += -static
2016-12-26 16:03:06 +00:00
endif
2017-01-08 03:19:28 +00:00
.PHONY: all
all: wdcdumpobj wdclink
2016-12-26 16:03:06 +00:00
2017-01-08 03:19:28 +00:00
wdcdumpobj : $(DUMP_OBJS)
2017-01-05 20:41:07 +00:00
$(LINK.o) $^ $(LDLIBS) -o $@
2016-12-25 05:04:17 +00:00
2017-01-08 03:19:28 +00:00
wdclink : $(LINK_OBJS)
$(LINK.o) $^ $(LDLIBS) -o $@
2016-12-25 05:04:17 +00:00
disassembler.o : disassembler.cpp disassembler.h
zrdz_disassembler.o : zrdz_disassembler.cpp zrdz_disassembler.h disassembler.h
dumpobj.o : dumpobj.cpp zrdz_disassembler.h disassembler.h
omf.o : omf.cpp omf.h
expression.o : expression.cpp expression.h
2017-01-23 15:02:50 +00:00
finder_info_helper.o : finder_info_helper.cpp finder_info_helper.h
2016-12-26 16:14:38 +00:00
mingw/err.o : mingw/err.c mingw/err.h
2016-12-24 22:09:12 +00:00
2016-12-26 16:03:06 +00:00
.PHONY: clean
2016-12-24 22:09:12 +00:00
clean:
2017-01-16 21:15:05 +00:00
$(RM) wdcdumpobj wdclink $(DUMP_OBJS) $(LINK_OBJS)
2016-12-26 16:14:38 +00:00
.PHONY: variables
variables :
$(foreach v, $(.VARIABLES), $(info $(v) = $($(v))))
@echo