Solved

Unix Makefile

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupNoAdj 7 95
Tomcat: Unable to run tomcat service. 2 18
by zero exception 10 39
How to determine if a string is a valid SHA value 7 28
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

813 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