Solved

Unix Makefile

Posted on 1998-07-31
2
224 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
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

747 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now