Solved

Unix Makefile

Posted on 1998-07-31
2
228 Views
Last Modified: 2010-03-30
Does anyone have a Unix Makefile that will compile both JAVA and C/C++.

Thanks in advance!
0
Comment
Question by:jefftk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
shchuka earned 50 total points
ID: 1229634
This is relatively simple.  Assuming that your path and classpath are set correctly...

#Makefile starts here
JAVAC = javac
CC = gxx
JAVAFLAGS = whatever parameters you need
CFLAGS = whatever parameters you need
LDFLAGS = whatever you need
CPROGRAMNAME = name of your cpp output file

all: javafiles cppfiles
    #do whatever you need with them together after each part is compiled

javafiles: class1 class2

cppfiles: cprograms

class1: class1.java
    $(JAVAC) $(JAVAFLAGS) class1.java

class2: class2.java
    $(JAVAC) $(JAVAFLAGS) class2.java

cppfiles: file1.o file2.o
    $(CC) $(LDFLAGS) -o $(CPROGRAMNAME) file1.o file2.o

file1.o file1.c file1.h
    $(CC) -c $(CFLAGS) file1.c

file2.o file2.c file2.h
    $(CC) -c $(CFLAGS) file2.c

#End of make file
0
 

Author Comment

by:jefftk
ID: 1229635
Thank you.
I will try to implement this code.


0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question