Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VSCode Config
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Binet Réseau
VSCode Config
Commits
8152f255
Commit
8152f255
authored
1 year ago
by
Thibaut DE SAIVRE
Browse files
Options
Downloads
Patches
Plain Diff
update makefile
parent
4cf814d5
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/Makefile
+8
-4
8 additions, 4 deletions
java/Makefile
with
8 additions
and
4 deletions
java/Makefile
+
8
−
4
View file @
8152f255
# Output and source directories
# Output and source directories
SOURCE_DIR
=
src
SOURCE_DIR
=
src
OUTPUT_DIR
=
out
OUTPUT_DIR
=
out
LIB_DIR
=
lib
# Main source and class files
# Main source and class files
SRC_FILE
=
Main
.java
SRC_FILE
=
EditorTD1
.java
CLASS_FILE
=
Main.class
CLASS_FILE
=
Main.class
# Java compiler and interpreter paths
# Java compiler and interpreter paths
JAVAC
=
javac
JAVAC
=
javac
JAVA
=
java
JAVA
=
java
# Classpath, including the "lib" directory
CLASSPATH
=
$(
OUTPUT_DIR
)
:
$(
LIB_DIR
)
/
*
.PHONY
:
all compile run clean
.PHONY
:
all compile run clean
# "make" will compile and run the program
# "make" will compile and run the program
...
@@ -17,12 +21,12 @@ all: compile run
...
@@ -17,12 +21,12 @@ all: compile run
# "make compile" will compile the program
# "make compile" will compile the program
compile
:
compile
:
$(
JAVAC
)
-sourcepath
$(
SOURCE_DIR
)
-d
$(
OUTPUT_DIR
)
$(
SOURCE_DIR
)
/
$(
SRC_FILE
)
$(
JAVAC
)
-sourcepath
$(
SOURCE_DIR
)
-d
$(
OUTPUT_DIR
)
-cp
$(
CLASSPATH
)
$(
SOURCE_DIR
)
/
$(
SRC_FILE
)
# "make run" will clear the terminal and run the program
# "make run" will clear the terminal and run the program
run
:
run
:
clear
clear
$(
JAVA
)
-classpath
$(
OUTPUT_DIR
)
$(
basename
$(
SRC_FILE
))
$(
JAVA
)
-classpath
$(
CLASSPATH
)
$(
basename
$(
SRC_FILE
))
# "make clean" will remove the output directory's contents
# "make clean" will remove the output directory's contents
clean
:
clean
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment