Makefile
author František Kučera <franta-hg@frantovo.cz>
Sat, 16 Dec 2023 23:54:00 +0100
branchv_0
changeset 40 1978eaf429de
parent 39 ec0e970e0830
child 44 c43c96b0ab1b
permissions -rw-r--r--
možnost spustit program přes Maven: mvn install exec:java
     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 SRC=$(shell find src -name '*.java')
    17 MAIN=cz.frantovo.rozsireneatributy.Startér
    18 LAF=-Dswing.defaultlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel
    19 VERSION=0.1-SNAPSHOT
    20 JAR=target/rozsirene-atributy-$(VERSION).jar
    21 
    22 all: $(JAR)
    23 
    24 .PHONY: all clean run run-binfmt
    25 
    26 clean:
    27 	rm -rf target
    28 
    29 target/classes: $(SRC)
    30 	mkdir -p target/classes
    31 	touch    target/classes
    32 	javac -d target/classes $(SRC)
    33 	cp \
    34 		src/main/resources/cz/frantovo/rozsireneatributy/*.properties \
    35 		target/classes/cz/frantovo/rozsireneatributy/
    36 
    37 $(JAR): target/classes
    38 	jar --create --file $(@) --main-class $(MAIN) -C target/classes .
    39 	chmod +x $(@)
    40 
    41 run: $(JAR)
    42 	java $(LAF) -jar $(<) --soubor $(<)
    43 
    44 run-binfmt: $(JAR)
    45 	$(<) --soubor $(<)