merlin-utils/Makefile

37 lines
618 B
Makefile
Raw Normal View History

2019-12-08 18:55:33 +00:00
LINK.o = $(LINK.cc)
CXXFLAGS = -std=c++17 -g -Wall -Wno-sign-compare
CCFLAGS = -g
2019-12-09 18:02:15 +00:00
CPPFLAGS += -I afp/include
2019-12-08 18:55:33 +00:00
2019-12-09 18:02:15 +00:00
.PHONY: all clean
2019-12-08 18:55:33 +00:00
2019-12-10 03:15:55 +00:00
all: merlin-link
2019-12-08 18:55:33 +00:00
2019-12-09 18:02:15 +00:00
clean:
2019-12-10 03:15:55 +00:00
$(RM) -rf merlin-link o
2019-12-09 18:02:15 +00:00
$(MAKE) -C afp clean
2019-12-08 18:55:33 +00:00
o:
mkdir $<
2019-12-10 03:15:55 +00:00
merlin-link: o/link.o o/mapped_file.o o/omf.o o/set_file_type.o afp/libafp.a
2019-12-08 18:55:33 +00:00
$(LINK.o) $^ $(LDLIBS) -o $@
o/mapped_file.o : mapped_file.cpp mapped_file.h unique_resource.h
o/link.o : link.cpp mapped_file.h omf.h
o/omf.o : omf.cpp omf.h
o/%.o: %.cpp | o
2019-12-09 18:02:15 +00:00
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
2019-12-08 18:55:33 +00:00
%.cpp: %.re2c
re2c -W -o $@ $<
2019-12-09 18:02:15 +00:00
.PHONY: subdirs
subdirs:
$(MAKE) -C afp
afp/libafp.a : subdirs