NetWare makefile tweaks.
Changed to use Windows commandline tools instead of GNU tools when compiling on Windows. Fixed dist and dev targets. Enabled nlmconv error for unresolved symbols.
This commit is contained in:
parent
5237177daf
commit
5c065bf1ff
112
nw/GNUmakefile
112
nw/GNUmakefile
@ -76,10 +76,7 @@ ifdef METROWERKS
|
|||||||
else
|
else
|
||||||
CC = $(CROSSPREFIX)gcc
|
CC = $(CROSSPREFIX)gcc
|
||||||
endif
|
endif
|
||||||
CP = cp -afv
|
|
||||||
MD = mkdir
|
|
||||||
RD = rm -fr
|
|
||||||
# RM = rm -f
|
|
||||||
# Here you can find a native Win32 binary of the original awk:
|
# Here you can find a native Win32 binary of the original awk:
|
||||||
# http://www.gknw.net/development/prgtools/awk-20100523.zip
|
# http://www.gknw.net/development/prgtools/awk-20100523.zip
|
||||||
AWK = awk
|
AWK = awk
|
||||||
@ -89,6 +86,34 @@ AWK = awk
|
|||||||
MPKXDC = mkxdc
|
MPKXDC = mkxdc
|
||||||
ZIP = zip -qzr9
|
ZIP = zip -qzr9
|
||||||
|
|
||||||
|
# Platform-dependent helper tool macros
|
||||||
|
ifeq ($(findstring /sh,$(SHELL)),/sh)
|
||||||
|
DEL = rm -f $1
|
||||||
|
RMDIR = rm -fr $1
|
||||||
|
MKDIR = mkdir -p $1
|
||||||
|
COPY = -cp -afv $1 $2
|
||||||
|
#COPYR = -cp -afr $1/* $2
|
||||||
|
COPYR = -rsync -aC $1/* $2
|
||||||
|
TOUCH = touch $1
|
||||||
|
CAT = cat
|
||||||
|
ECHONL = echo ""
|
||||||
|
DL = '
|
||||||
|
else
|
||||||
|
ifeq "$(OS)" "Windows_NT"
|
||||||
|
DEL = -del 2>NUL /q /f $(subst /,\,$1)
|
||||||
|
RMDIR = -rd 2>NUL /q /s $(subst /,\,$1)
|
||||||
|
else
|
||||||
|
DEL = -del 2>NUL $(subst /,\,$1)
|
||||||
|
RMDIR = -deltree 2>NUL /y $(subst /,\,$1)
|
||||||
|
endif
|
||||||
|
MKDIR = -md 2>NUL $(subst /,\,$1)
|
||||||
|
COPY = -copy 2>NUL /y $(subst /,\,$1) $(subst /,\,$2)
|
||||||
|
COPYR = -xcopy 2>NUL /q /y /e $(subst /,\,$1) $(subst /,\,$2)
|
||||||
|
TOUCH = copy 2>&1>NUL /b $(subst /,\,$1) +,,
|
||||||
|
CAT = type
|
||||||
|
ECHONL = $(ComSpec) /c echo.
|
||||||
|
endif
|
||||||
|
|
||||||
# LIBARCH_U = $(shell $(AWK) 'BEGIN {print toupper(ARGV[1])}' $(LIBARCH))
|
# LIBARCH_U = $(shell $(AWK) 'BEGIN {print toupper(ARGV[1])}' $(LIBARCH))
|
||||||
LIBARCH_L = $(shell $(AWK) 'BEGIN {print tolower(ARGV[1])}' $(LIBARCH))
|
LIBARCH_L = $(shell $(AWK) 'BEGIN {print tolower(ARGV[1])}' $(LIBARCH))
|
||||||
|
|
||||||
@ -120,13 +145,14 @@ else
|
|||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
LD = $(CROSSPREFIX)nlmconv
|
LD = $(CROSSPREFIX)nlmconv
|
||||||
LDFLAGS = -T
|
LDFLAGS = -UT
|
||||||
AR = $(CROSSPREFIX)ar
|
AR = $(CROSSPREFIX)ar
|
||||||
ARFLAGS = -cq
|
ARFLAGS = -cq
|
||||||
LIBEXT = a
|
LIBEXT = a
|
||||||
RANLIB = $(CROSSPREFIX)ranlib
|
RANLIB = $(CROSSPREFIX)ranlib
|
||||||
CFLAGS += -m32
|
CFLAGS += -m32
|
||||||
CFLAGS += -fno-builtin -fpcc-struct-return -fno-strict-aliasing
|
CFLAGS += -fno-builtin -fpcc-struct-return
|
||||||
|
CFLAGS += -fno-strict-aliasing
|
||||||
CFLAGS += -Wall # -pedantic
|
CFLAGS += -Wall # -pedantic
|
||||||
#CFLAGS += -Wno-pointer-sign
|
#CFLAGS += -Wno-pointer-sign
|
||||||
ifeq ($(LIBARCH),LIBC)
|
ifeq ($(LIBARCH),LIBC)
|
||||||
@ -185,13 +211,6 @@ ifdef XDCOPT
|
|||||||
XDCDATA = $(OBJDIR)/$(TARGET).xdc
|
XDCDATA = $(OBJDIR)/$(TARGET).xdc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(findstring /sh,$(SHELL)),/sh)
|
|
||||||
DL = '
|
|
||||||
DS = /
|
|
||||||
else
|
|
||||||
DS = \\
|
|
||||||
endif
|
|
||||||
|
|
||||||
vpath %.c . ../src
|
vpath %.c . ../src
|
||||||
|
|
||||||
# include Makefile.inc to get CSOURCES define
|
# include Makefile.inc to get CSOURCES define
|
||||||
@ -223,67 +242,68 @@ $(OBJDIR)/%.o: %.c
|
|||||||
# @echo Compiling $<
|
# @echo Compiling $<
|
||||||
$(CC) $(CFLAGS) -c $< -o $@
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
$(OBJDIR)/version.inc: ../include/libssh2.h $(OBJDIR)
|
$(OBJDIR)/version.inc: ../get_ver.awk ../include/libssh2.h $(OBJDIR)
|
||||||
@echo Creating $@
|
@echo Creating $@
|
||||||
@$(AWK) -f ../get_ver.awk $< > $@
|
@$(AWK) -f $^ > $@
|
||||||
|
|
||||||
dist: all $(DISTDIR) $(DISTDIR)/readme.txt
|
dist: all $(DISTDIR) $(DISTDIR)/readme.txt
|
||||||
@-$(MD) $(DISTDIR)$(DS)bin
|
@$(call MD, $(DISTDIR)/bin)
|
||||||
@-$(CP) ../AUTHORS $(DISTDIR)
|
@$(call CP, ../AUTHORS, $(DISTDIR))
|
||||||
@-$(CP) ../COPYING $(DISTDIR)
|
@$(call CP, ../COPYING, $(DISTDIR))
|
||||||
@-$(CP) ../INSTALL $(DISTDIR)
|
@$(call CP, ../INSTALL, $(DISTDIR))
|
||||||
@-$(CP) ../README $(DISTDIR)
|
@$(call CP, ../README, $(DISTDIR))
|
||||||
@-$(CP) ../RELEASE-NOTES $(DEVLDIR)
|
@$(call CP, ../RELEASE-NOTES, $(DISTDIR))
|
||||||
@$(CP) $(TARGET).nlm $(DISTDIR)/bin
|
@$(call CP, $(TARGET).nlm, $(DISTDIR)/bin)
|
||||||
@echo Creating $(DISTARC)
|
@echo Creating $(DISTARC)
|
||||||
@$(ZIP) $(DISTARC) $(DISTDIR)/* < $(DISTDIR)/readme.txt
|
@$(ZIP) $(DISTARC) $(DISTDIR)/* < $(DISTDIR)/readme.txt
|
||||||
|
|
||||||
dev: all $(DEVLDIR) $(DEVLDIR)/readme.txt
|
dev: all $(DEVLDIR) $(DEVLDIR)/readme.txt
|
||||||
@-$(MD) $(DEVLDIR)$(DS)bin
|
@$(call MD, $(DEVLDIR)/bin)
|
||||||
@-$(MD) $(DEVLDIR)$(DS)include
|
@$(call MD, $(DEVLDIR)/include)
|
||||||
@-$(MD) $(DEVLDIR)$(DS)nw
|
@$(call MD, $(DEVLDIR)/nw)
|
||||||
@-$(CP) ../AUTHORS $(DISTDIR)
|
@$(call CP, ../AUTHORS, $(DEVLDIR))
|
||||||
@-$(CP) ../COPYING $(DISTDIR)
|
@$(call CP, ../COPYING, $(DEVLDIR))
|
||||||
@-$(CP) ../INSTALL $(DEVLDIR)
|
@$(call CP, ../INSTALL, $(DEVLDIR))
|
||||||
@-$(CP) ../README $(DEVLDIR)
|
@$(call CP, ../README, $(DEVLDIR))
|
||||||
@-$(CP) ../RELEASE-NOTES $(DEVLDIR)
|
@$(call CP, ../RELEASE-NOTES, $(DEVLDIR))
|
||||||
@$(CP) $(TARGET).nlm $(DEVLDIR)/bin
|
@$(call CP, ../include/*.h, $(DEVLDIR)/include)
|
||||||
@$(CP) ../include/*.h $(DEVLDIR)/include
|
@$(call CP, libssh2_config.h, $(DEVLDIR)/include)
|
||||||
@$(CP) libssh2_config.h $(DEVLDIR)/include
|
@$(call CP, $(TARGET).nlm, $(DEVLDIR)/bin)
|
||||||
@$(CP) $(TARGET).$(LIBEXT) $(DEVLDIR)/nw
|
@$(call CP, $(TARGET).imp, $(DEVLDIR)/nw)
|
||||||
|
@$(call CP, $(TARGET).$(LIBEXT), $(DEVLDIR)/nw)
|
||||||
@echo Creating $(DEVLARC)
|
@echo Creating $(DEVLARC)
|
||||||
@$(ZIP) $(DEVLARC) $(DEVLDIR)/* < $(DEVLDIR)/readme.txt
|
@$(ZIP) $(DEVLARC) $(DEVLDIR)/* < $(DEVLDIR)/readme.txt
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
-$(RD) $(DISTDIR)
|
$(call RMDIR, $(DISTDIR))
|
||||||
-$(RM) $(DISTARC)
|
$(call DEL, $(DISTARC))
|
||||||
|
|
||||||
devclean: clean
|
devclean: clean
|
||||||
-$(RD) $(DEVLDIR)
|
$(call RMDIR, $(DEVLDIR))
|
||||||
-$(RM) $(DEVLARC)
|
$(call DEL, $(DEVLARC))
|
||||||
|
|
||||||
objclean:
|
objclean:
|
||||||
-$(RD) $(OBJDIR)
|
$(call RMDIR, $(OBJDIR))
|
||||||
|
|
||||||
testclean: clean
|
testclean: clean
|
||||||
$(MAKE) -C test clean
|
$(MAKE) -C test clean
|
||||||
|
|
||||||
clean: objclean
|
clean: objclean
|
||||||
-$(RM) libssh2_config.h
|
$(call DEL, libssh2_config.h)
|
||||||
-$(RM) $(TARGET).nlm $(TARGET).$(LIBEXT) $(TARGET).imp
|
$(call DEL, $(TARGET).*)
|
||||||
|
|
||||||
$(OBJDIR):
|
$(OBJDIR):
|
||||||
@$(MD) $@
|
@$(call MKDIR, $@)
|
||||||
|
|
||||||
$(DISTDIR):
|
$(DISTDIR):
|
||||||
@$(MD) $@
|
@$(call MKDIR, $@)
|
||||||
|
|
||||||
$(DEVLDIR):
|
$(DEVLDIR):
|
||||||
@$(MD) $@
|
@$(call MKDIR, $@)
|
||||||
|
|
||||||
$(TARGET).$(LIBEXT): $(OBJS)
|
$(TARGET).$(LIBEXT): $(OBJS)
|
||||||
@echo Creating $@
|
@echo Creating $@
|
||||||
@-$(RM) $@
|
@$(call DEL, $@)
|
||||||
@$(AR) $(ARFLAGS) $@ $^
|
@$(AR) $(ARFLAGS) $@ $^
|
||||||
ifdef RANLIB
|
ifdef RANLIB
|
||||||
@$(RANLIB) $@
|
@$(RANLIB) $@
|
||||||
@ -291,7 +311,7 @@ endif
|
|||||||
|
|
||||||
$(TARGET).nlm: $(OBJDIR)/$(TARGET).def $(TARGET).imp $(OBJL) $(XDCDATA)
|
$(TARGET).nlm: $(OBJDIR)/$(TARGET).def $(TARGET).imp $(OBJL) $(XDCDATA)
|
||||||
@echo Linking $@
|
@echo Linking $@
|
||||||
@-$(RM) $@
|
@$(call DEL, $@)
|
||||||
@$(LD) $(LDFLAGS) $<
|
@$(LD) $(LDFLAGS) $<
|
||||||
|
|
||||||
$(OBJDIR)/%.xdc: GNUmakefile
|
$(OBJDIR)/%.xdc: GNUmakefile
|
||||||
|
@ -69,10 +69,7 @@ ifdef METROWERKS
|
|||||||
else
|
else
|
||||||
CC = $(CROSSPREFIX)gcc
|
CC = $(CROSSPREFIX)gcc
|
||||||
endif
|
endif
|
||||||
CP = cp -afv
|
|
||||||
MD = mkdir
|
|
||||||
RD = rm -fr
|
|
||||||
# RM = rm -f
|
|
||||||
# Here you can find a native Win32 binary of the original awk:
|
# Here you can find a native Win32 binary of the original awk:
|
||||||
# http://www.gknw.net/development/prgtools/awk-20100523.zip
|
# http://www.gknw.net/development/prgtools/awk-20100523.zip
|
||||||
AWK = awk
|
AWK = awk
|
||||||
@ -81,6 +78,34 @@ AWK = awk
|
|||||||
# http://www.gknw.net/development/prgtools/mkxdc.zip
|
# http://www.gknw.net/development/prgtools/mkxdc.zip
|
||||||
MPKXDC = mkxdc
|
MPKXDC = mkxdc
|
||||||
|
|
||||||
|
# Platform-dependent helper tool macros
|
||||||
|
ifeq ($(findstring /sh,$(SHELL)),/sh)
|
||||||
|
DEL = rm -f $1
|
||||||
|
RMDIR = rm -fr $1
|
||||||
|
MKDIR = mkdir -p $1
|
||||||
|
COPY = -cp -afv $1 $2
|
||||||
|
#COPYR = -cp -afr $1/* $2
|
||||||
|
COPYR = -rsync -aC $1/* $2
|
||||||
|
TOUCH = touch $1
|
||||||
|
CAT = cat
|
||||||
|
ECHONL = echo ""
|
||||||
|
DL = '
|
||||||
|
else
|
||||||
|
ifeq "$(OS)" "Windows_NT"
|
||||||
|
DEL = -del 2>NUL /q /f $(subst /,\,$1)
|
||||||
|
RMDIR = -rd 2>NUL /q /s $(subst /,\,$1)
|
||||||
|
else
|
||||||
|
DEL = -del 2>NUL $(subst /,\,$1)
|
||||||
|
RMDIR = -deltree 2>NUL /y $(subst /,\,$1)
|
||||||
|
endif
|
||||||
|
MKDIR = -md 2>NUL $(subst /,\,$1)
|
||||||
|
COPY = -copy 2>NUL /y $(subst /,\,$1) $(subst /,\,$2)
|
||||||
|
COPYR = -xcopy 2>NUL /q /y /e $(subst /,\,$1) $(subst /,\,$2)
|
||||||
|
TOUCH = copy 2>&1>NUL /b $(subst /,\,$1) +,,
|
||||||
|
CAT = type
|
||||||
|
ECHONL = $(ComSpec) /c echo.
|
||||||
|
endif
|
||||||
|
|
||||||
# LIBARCH_U = $(shell $(AWK) 'BEGIN {print toupper(ARGV[1])}' $(LIBARCH))
|
# LIBARCH_U = $(shell $(AWK) 'BEGIN {print toupper(ARGV[1])}' $(LIBARCH))
|
||||||
LIBARCH_L = $(shell $(AWK) 'BEGIN {print tolower(ARGV[1])}' $(LIBARCH))
|
LIBARCH_L = $(shell $(AWK) 'BEGIN {print tolower(ARGV[1])}' $(LIBARCH))
|
||||||
|
|
||||||
@ -111,12 +136,13 @@ else
|
|||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
LD = nlmconv
|
LD = nlmconv
|
||||||
LDFLAGS = -T
|
LDFLAGS = -UT
|
||||||
AR = ar
|
AR = ar
|
||||||
ARFLAGS = -cq
|
ARFLAGS = -cq
|
||||||
LIBEXT = a
|
LIBEXT = a
|
||||||
CFLAGS += -m32
|
CFLAGS += -m32
|
||||||
CFLAGS += -fno-builtin -fpcc-struct-return -fno-strict-aliasing
|
CFLAGS += -fno-builtin -fpcc-struct-return
|
||||||
|
CFLAGS += -fno-strict-aliasing
|
||||||
CFLAGS += -Wall # -pedantic
|
CFLAGS += -Wall # -pedantic
|
||||||
ifeq ($(LIBARCH),LIBC)
|
ifeq ($(LIBARCH),LIBC)
|
||||||
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
|
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
|
||||||
@ -180,13 +206,6 @@ ifeq ($(MTSAFE),NO)
|
|||||||
XDCOPT = -u
|
XDCOPT = -u
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(findstring /sh,$(SHELL)),/sh)
|
|
||||||
DL = '
|
|
||||||
DS = /
|
|
||||||
else
|
|
||||||
DS = \\
|
|
||||||
endif
|
|
||||||
|
|
||||||
vpath %.c $(SAMPLES)
|
vpath %.c $(SAMPLES)
|
||||||
|
|
||||||
.PRECIOUS: $(OBJDIR)/%.o $(OBJDIR)/%.def $(OBJDIR)/%.xdc
|
.PRECIOUS: $(OBJDIR)/%.o $(OBJDIR)/%.def $(OBJDIR)/%.xdc
|
||||||
@ -200,22 +219,22 @@ $(OBJDIR)/%.o: %.c
|
|||||||
# @echo Compiling $<
|
# @echo Compiling $<
|
||||||
$(CC) $(CFLAGS) -c $< -o $@
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
$(OBJDIR)/version.inc: ../../include/libssh2.h $(OBJDIR)
|
$(OBJDIR)/version.inc: ../../get_ver.awk ../../include/libssh2.h $(OBJDIR)
|
||||||
@echo Creating $@
|
@echo Creating $@
|
||||||
@$(AWK) -f ../../get_ver.awk $< > $@
|
@$(AWK) -f $^ > $@
|
||||||
|
|
||||||
objclean:
|
objclean:
|
||||||
-$(RD) $(OBJDIR)
|
$(call RMDIR, $(OBJDIR))
|
||||||
|
|
||||||
clean: objclean
|
clean: objclean
|
||||||
-$(RM) $(TARGETS)
|
$(foreach f, $(TARGETS), $(call DEL, $(f)))
|
||||||
|
|
||||||
$(OBJDIR):
|
$(OBJDIR):
|
||||||
@$(MD) $@
|
@$(call MKDIR, $@)
|
||||||
|
|
||||||
%.nlm: $(OBJDIR)/%.def $(OBJDIR)/%.o $(OBJDIR)/%.xdc
|
%.nlm: $(OBJDIR)/%.def $(OBJDIR)/%.o $(OBJDIR)/%.xdc
|
||||||
@echo Linking $@
|
@echo Linking $@
|
||||||
@-$(RM) $@
|
@$(call DEL, $@)
|
||||||
@$(LD) $(LDFLAGS) $<
|
@$(LD) $(LDFLAGS) $<
|
||||||
|
|
||||||
$(OBJDIR)/%.xdc: GNUmakefile
|
$(OBJDIR)/%.xdc: GNUmakefile
|
||||||
|
Loading…
x
Reference in New Issue
Block a user