aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authoraindros <aindros@hotmail.com>2020-05-13 01:45:16 +0200
committeraindros <aindros@hotmail.com>2020-05-13 01:45:16 +0200
commit1f99e21c23f32fcc4bd2185af6cf1710c98f413a (patch)
tree4b349f2b21f0448a8526df25a6e06beb3b12b87e /win32
parentc4f15aa3a95d61ebd333b64662164e27d232ec04 (diff)
downloadcherry-1f99e21c23f32fcc4bd2185af6cf1710c98f413a.tar.gz
cherry-1f99e21c23f32fcc4bd2185af6cf1710c98f413a.zip
Sources, samples and makefile (first alpha version)
Diffstat (limited to 'win32')
-rw-r--r--win32/Makefile59
-rw-r--r--win32/main.c37
2 files changed, 96 insertions, 0 deletions
diff --git a/win32/Makefile b/win32/Makefile
new file mode 100644
index 0000000..a720e83
--- /dev/null
+++ b/win32/Makefile
@@ -0,0 +1,59 @@
+# ------------------------------------------------------------------------------
+# Generic makefile
+#
+# Author: Alessandro Iezzi info@alessandroiezzi.it
+# Date : 2020-05-06
+#
+# Changelog:
+# 2020-05-06 - first version
+# ------------------------------------------------------------------------------
+
+SRC = ..\src
+OBJ = ..\build
+BIN = ..\bin
+RM = DEL /Q
+CC = cl
+CFLAGS = /c /DUNICODE /D_UNICODE
+LINKER = link
+LFLAGS = /DLL User32.lib
+
+OBJECT_FILES = $(OBJ)/cherry.obj \
+ $(OBJ)/main.obj
+INCLUDE_FILES = $(BIN)/include/cherry.h
+
+$(BIN)/cherry.dll: $(BIN) $(INCLUDE_FILES) $(OBJECT_FILES)
+ lib /out:$(BIN)/lib/cherry.lib $(OBJECT_FILES)
+ @$(LINKER) $(LFLAGS) /out:$(BIN)/lib/cherry.dll $(OBJECT_FILES)
+
+$(BIN)/include/cherry.h: $(SRC)/cherry.h
+ copy $(SRC)\cherry.h $(BIN)\include\cherry.h
+
+$(OBJ)/cherry.obj: $(OBJ) $(SRC)/cherry.c $(SRC)/cherry.h
+ $(CC) $(CFLAGS) $(SRC)/cherry.c /Fo"$(OBJ)\cherry.obj"
+
+$(OBJ)/main.obj: $(OBJ) main.c
+ $(CC) $(CFLAGS) main.c /Fo"$(OBJ)\main.obj"
+
+all: $(OBJ) $(BIN)
+
+$(OBJ):
+ mkdir $(OBJ)
+
+$(BIN):
+ mkdir $(BIN)
+ mkdir $(BIN)\lib
+ mkdir $(BIN)\include
+
+clean:
+# Remove OBJ directory
+ if exist $(OBJ) $(RM) $(OBJ)
+ if exist $(OBJ) rmdir /Q $(OBJ)
+# Remove lib directory
+ if exist $(BIN)\lib $(RM) $(BIN)\lib
+ if exist $(BIN)\lib rmdir $(BIN)\lib
+# Remove include directory
+ if exist $(BIN)\include $(RM) $(BIN)\include
+ if exist $(BIN)\include rmdir $(BIN)\include
+# Remove BIN directory
+ if exist $(BIN) $(RM) $(BIN)
+ if exist $(BIN) rmdir /Q $(BIN)
diff --git a/win32/main.c b/win32/main.c
new file mode 100644
index 0000000..11ed005
--- /dev/null
+++ b/win32/main.c
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 2020 Alessandro Iezzi
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <windows.h>
+
+BOOL APIENTRY DllMain( HANDLE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
+{
+ switch ( fdwReason ) {
+ case DLL_PROCESS_ATTACH:
+ // Here goes the default register class
+ break;
+ }
+
+ return TRUE;
+}