-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Makefile: extract linux specific things to separate file
Makefile.linux handles the linux specific build. "make linux-<something>" targets runs the same targets as "make <something>" has run before. References: jira SCB-8086
- Loading branch information
Showing
7 changed files
with
88 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,14 @@ | ||
# Makefile for putty puttyparser parser for ADP | ||
linux: | ||
$(MAKE) $(MFLAGS) linux-dep | ||
$(MAKE) $(MFLAGS) linux-all | ||
$(MAKE) $(MFLAGS) linux-install | ||
|
||
libdir=$(PREFIX)/lib | ||
incdir=$(PREFIX)/include | ||
|
||
CFLAGS = -O2 -Wall -g -I. -I./ -I./charset/ -I./unix -I$(incdir) -fPIC -DNO_GSSAPI | ||
CCFLAGS = $(CFLAGS) | ||
INSTALL = install | ||
|
||
TARGET=libtermcapparser.so | ||
HEADER_DIR=putty | ||
HEADERS=$(HEADER_DIR)/termcapparser.hh $(HEADER_DIR)/state.hh $(HEADER_DIR)/row.hh $(HEADER_DIR)/cell.hh $(HEADER_DIR)/palette.hh | ||
LDFLAGS+=-shared | ||
linux-%: | ||
$(MAKE) $(MFLAGS) -f Makefile.linux $* | ||
|
||
CXX_OBJS = puttyparser.cc termcapparser.cc state.cc cell.cc row.cc palette.cc | ||
help: | ||
@cat README.md | ||
|
||
C_OBJS = charset/fromucs.c ldisc.c ldiscucs.c charset/localenc.c charset/mimeenc.c minibidi.c misc.c charset/sbcs.c charset/sbcsdat.c charset/slookup.c terminal.c time.c fake_timing.c charset/toucs.c tree234.c charset/utf8.c unix/uxmisc.c unix/uxucs.c wcwidth.c charset/xenc.c | ||
|
||
OBJECTS = $(notdir $(CXX_OBJS:.cc=.o) $(C_OBJS:.c=.o)) | ||
|
||
all: $(TARGET) | ||
|
||
$(TARGET): $(OBJECTS) | ||
$(CXX) -fPIC $(LDFLAGS) -o $@ $(OBJECTS) | ||
|
||
$(CXX_OBJS:.cc=.o): | ||
$(CXX) $(COMPAT) $(CCFLAGS) -c $< | ||
|
||
$(notdir $(C_OBJS:.c=.o)): | ||
$(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c $< | ||
|
||
|
||
install: $(TARGET) | ||
mkdir -p $(DESTDIR)$(libdir) | ||
mkdir -p $(DESTDIR)$(incdir)/$(HEADER_DIR) | ||
$(INSTALL) -m 755 $(TARGET) $(DESTDIR)$(libdir)/$(TARGET) | ||
$(INSTALL) -m 644 $(HEADERS) -t $(DESTDIR)$(incdir)/$(HEADER_DIR) | ||
|
||
uninstall: | ||
rm -f $(DESTDIR)$(libdir)/$(TARGET) | ||
rm -f $(DESTDIR)$(incdir)/$(HEADERS) | ||
rmdir $(DESTDIR)$(incdir)/$(HEADER_DIR) 2>/dev/null || true | ||
rmdir $(DESTDIR)$(libdir) 2>/dev/null || true | ||
|
||
install-strip: | ||
$(MAKE) install INSTALL="$(INSTALL) -s" | ||
|
||
clean: | ||
rm -f $(OBJECTS) $(TARGET) | ||
$(MAKE) -C tests clean | ||
|
||
distclean: clean | ||
rm -f Makefile.* | ||
|
||
check: install | ||
$(MAKE) -C tests | ||
|
||
NODEP_TARGETS = | ||
|
||
dep: $(C_OBJS) $(CXX_OBJS) | ||
$(CC) -MM $(COMPAT) $(CFLAGS) $(XFLAGS) $^ > Makefile.dep | ||
ifeq ($(filter $(MAKECMDGOALS),$(NODEP_TARGETS)),) | ||
-include Makefile.dep | ||
endif | ||
.PHONY: linux win32 help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
libdir=$(PREFIX)/lib | ||
incdir=$(PREFIX)/include | ||
|
||
CFLAGS_COMMON = -O2 -Wall -g -I./ -I./charset/ -DNO_GSSAPI | ||
INSTALL = install | ||
|
||
HEADER_DIR=putty | ||
HEADERS=$(HEADER_DIR)/termcapparser.hh $(HEADER_DIR)/state.hh $(HEADER_DIR)/row.hh $(HEADER_DIR)/cell.hh $(HEADER_DIR)/palette.hh | ||
LDFLAGS+=-shared | ||
|
||
CXX_OBJS = puttyparser.cc termcapparser.cc state.cc cell.cc row.cc palette.cc | ||
|
||
C_OBJS_COMMON = ldisc.c ldiscucs.c minibidi.c misc.c terminal.c time.c fake_timing.c tree234.c wcwidth.c charset/utf8.c charset/sbcsdat.c charset/fromucs.c charset/localenc.c charset/mimeenc.c charset/sbcs.c charset/slookup.c charset/toucs.c charset/xenc.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
include Makefile.head | ||
|
||
TARGET_OS=linux | ||
|
||
CFLAGS = $(CFLAGS_COMMON) -I./unix -fPIC | ||
|
||
TARGET=libtermcapparser.so | ||
|
||
C_OBJS = $(C_OBJS_COMMON) unix/uxmisc.c unix/uxucs.c | ||
|
||
include Makefile.tail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
OBJECTS = $(notdir $(CXX_OBJS:.cc=.o) $(C_OBJS:.c=.o)) | ||
CCFLAGS = $(CFLAGS) | ||
MAKEFILE_DEP = Makefile.$(TARGET_OS).dep | ||
|
||
all: $(TARGET) | ||
|
||
$(TARGET): $(OBJECTS) | ||
$(CXX) $(LDFLAGS) -o $@ $(OBJECTS) | ||
|
||
$(CXX_OBJS:.cc=.o): | ||
$(CXX) $(COMPAT) $(CCFLAGS) -c $< | ||
|
||
$(notdir $(C_OBJS:.c=.o)): | ||
$(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c $< | ||
|
||
|
||
install: $(TARGET) | ||
mkdir -p $(DESTDIR)$(libdir) | ||
mkdir -p $(DESTDIR)$(incdir)/$(HEADER_DIR) | ||
$(INSTALL) -m 755 $(TARGET) $(DESTDIR)$(libdir)/$(TARGET) | ||
$(INSTALL) -m 644 $(HEADERS) -t $(DESTDIR)$(incdir)/$(HEADER_DIR) | ||
|
||
uninstall: | ||
rm -f $(DESTDIR)$(libdir)/$(TARGET) | ||
rm -f $(DESTDIR)$(incdir)/$(HEADERS) | ||
rmdir $(DESTDIR)$(incdir)/$(HEADER_DIR) 2>/dev/null || true | ||
rmdir $(DESTDIR)$(libdir) 2>/dev/null || true | ||
|
||
install-strip: | ||
$(MAKE) $(MFLAGS) install INSTALL="$(INSTALL) -s" | ||
|
||
check: install | ||
$(MAKE) $(MFLAGS) -C tests -f Makefile.$(TARGET_OS) | ||
|
||
clean: | ||
rm -f $(OBJECTS) $(TARGET) | ||
$(MAKE) $(MFLAGS) -C tests -f Makefile.$(TARGET_OS) clean | ||
|
||
distclean: clean | ||
rm -f $(MAKEFILE_DEP) | ||
|
||
NODEP_TARGETS = | ||
|
||
dep: $(C_OBJS) $(CXX_OBJS) | ||
$(CC) -MM $(COMPAT) $(CFLAGS) $(XFLAGS) $^ >$(MAKEFILE_DEP) | ||
ifeq ($(filter $(MAKECMDGOALS),$(NODEP_TARGETS)),) | ||
-include $(MAKEFILE_DEP) | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters