Browse Source

added Makefile

Johann 5 years ago
parent
commit
5605723a59
4 changed files with 79 additions and 0 deletions
  1. 34 0
      Makefile
  2. 17 0
      winmake/copyfile.bat
  3. 14 0
      winmake/remove.bat
  4. 14 0
      winmake/removedir.bat

+ 34 - 0
Makefile

@@ -0,0 +1,34 @@
+all: compile
+
+install: not_installable
+uninstall: not_installable
+
+not_installable:
+	echo "The library cannot be installed on the system but statically linked to another Lazarus package or application."
+
+init:
+ifeq ($(OS),Windows_NT)     # true for Windows_NT or later
+  COPY := winmake\copyfile
+  REMOVE := winmake\remove
+  REMOVEDIR := winmake\removedir
+  THEN := &
+  RUN :=
+else
+  COPY := cp
+  REMOVE := rm -f
+  REMOVEDIR := rm -rf
+  THEN := ;
+  RUN := ./
+  RUN := $(strip $(RUN))
+endif
+
+clean: init clean_bgracontrols
+
+clean_bgracontrols:
+	$(REMOVEDIR) "lib"
+	$(REMOVEDIR) "backup"
+
+compile: init BGRAControls
+BGRAControls: bgracontrols.lpk
+	lazbuild bgracontrols.lpk
+

+ 17 - 0
winmake/copyfile.bat

@@ -0,0 +1,17 @@
+@echo off
+if "%~1" == "" goto argument
+if "%~2" == "" goto argument
+setlocal
+set FILENAME=%1
+set FILENAME=%FILENAME:/=\%
+set DESTINATION=%2
+set DESTINATION=%DESTINATION:/=\%
+copy /y %FILENAME% %DESTINATION%
+exit /b 0
+
+:argument
+echo Copies a file to the specified destination.
+echo Usage: copyfile [FILENAME] [DESTINATION]
+exit /b 1
+
+

+ 14 - 0
winmake/remove.bat

@@ -0,0 +1,14 @@
+@echo off
+if "%~1" == "" goto argument
+setlocal
+set FILENAME=%1
+set FILENAME=%FILENAME:/=\%
+if exist %FILENAME% del /f /q %FILENAME%
+exit /b 0
+
+:argument
+echo Removes a file if it exists.
+echo Usage: remove [FILENAME]
+exit /b 1
+
+

+ 14 - 0
winmake/removedir.bat

@@ -0,0 +1,14 @@
+@echo off
+if "%~1" == "" goto argument
+setlocal
+set DIRNAME=%1
+set DIRNAME=%DIRNAME:/=\%
+if exist %DIRNAME% rd /s /q %DIRNAME%
+exit /b 0
+
+:argument
+echo Removes a directory and all its content if it exists.
+echo Usage: removedir [DIRNAME]
+exit /b 1
+
+