← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcpp-plugin-sdk-cpp/trunk] Rev 10: fix the makefile to run without cygwin

 

------------------------------------------------------------
revno: 10
committer: poy <poy@xxxxxxxxxx>
branch nick: dcpp-plugin-sdk-cpp
timestamp: Sun 2013-02-03 22:30:26 +0100
message:
  fix the makefile to run without cygwin
modified:
  projects/make/Makefile


--
lp:dcpp-plugin-sdk-cpp
https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-cpp/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcpp-plugin-sdk-cpp.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-cpp/trunk/+edit-subscription
=== modified file 'projects/make/Makefile'
--- projects/make/Makefile	2012-12-27 14:00:26 +0000
+++ projects/make/Makefile	2013-02-03 21:30:26 +0000
@@ -35,8 +35,17 @@
 				-DWIN32 -D_WIN32 -DUNICODE -D_UNICODE
 	OBJS += src/resource.o
 	LIBEXT = .dll
+	ifeq ($(findstring Cygwin, $(SHELL)),)
+		MKDIR = if not exist $(subst /,\,$1) md $(subst /,\,$1)
+		RMDIR = if exist $(subst /,\,$1) rd /s /q $(subst /,\,$1)
+	else
+		MKDIR = mkdir -p $1
+		RMDIR += $(RM) -r $1
+	endif
 else
 	LIBEXT = .so
+	MKDIR = mkdir -p $1
+	RMDIR += $(RM) -r $1
 endif
 
 all: \
@@ -47,10 +56,11 @@
 	cd $(OUTPUT_DIR); $(CXX) $^ $(LINKFLAGS) -o $@$(LIBEXT)
 
 ensure-dirs:
-	mkdir -p $(OUTPUT_DIR)/pluginsdk $(OUTPUT_DIR)/src
+	$(call MKDIR,$(OUTPUT_DIR)/pluginsdk)
+	$(call MKDIR,$(OUTPUT_DIR)/src)
 
 src/resource.o:
 	windres ../../src/resource.rc $(OUTPUT_OPTION)
 
 clear:
-	$(RM) -r $(OUTPUT_DIR)
+	$(call RMDIR,$(OUTPUT_DIR))