java/rozsirene-atributy/Makefile
author František Kučera <franta-hg@frantovo.cz>
Sat, 16 Dec 2023 14:14:40 +0100
branchv_0
changeset 36 a7de67e6578c
permissions -rw-r--r--
přidán Makefile - možnost sestavení bez Antu (nebo Mavenu)
     1 # Rozšířené atributy – program na správu rozšířených atributů souborů
     2 # Copyright © 2023 František Kučera (Frantovo.cz)
     3 #
     4 # This program is free software: you can redistribute it and/or modify
     5 # it under the terms of the GNU General Public License as published by
     6 # the Free Software Foundation, version 3 of the License.
     7 #
     8 # This program is distributed in the hope that it will be useful,
     9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
    10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    11 # GNU General Public License for more details.
    12 #
    13 # You should have received a copy of the GNU General Public License
    14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
    15 
    16 all: dist/rozsirene-atributy.jar
    17 
    18 .PHONY: all clean run run-binfmt
    19 
    20 clean:
    21 	rm -rf build
    22 	rm -rf dist
    23 
    24 SRC=$(shell find -name '*.java')
    25 MAIN=cz.frantovo.rozsireneatributy.Startér
    26 LAF=-Dswing.defaultlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel
    27 JAR=dist/rozsirene-atributy.jar
    28 
    29 build: $(SRC)
    30 	mkdir -p build
    31 	touch    build
    32 	javac -d build $(SRC)
    33 	cp \
    34 		src/cz/frantovo/rozsireneatributy/*.properties \
    35 		build/cz/frantovo/rozsireneatributy/
    36 
    37 $(JAR): build
    38 	mkdir -p dist
    39 	jar --create --file $(@) --main-class $(MAIN) -C build .
    40 	chmod +x $(@)
    41 
    42 run: $(JAR)
    43 	java $(LAF) -jar $(<) --soubor $(<)
    44 
    45 run-binfmt: $(JAR)
    46 	$(<) --soubor $(<)