Makefile to compile both C and Java programs at the same time -


I have three programs, which have to be compiled at the same time, are written in 2C and 1 is in Java . I was working with the three Macfiles when they were in C, but then rewritten one of them in Java ... Is there a way to compile all 3 with the same messfile?

This is my current makefile:

  cc = gcc jc = jwack jflgs = -g cflgas = -wol-g -stdie = cml ldfalgs = -lm UFOX: Java. Class .java Class: $ (Jesse) $ (JFALGS) $ *. Java Classes = CasCia.Java Kentry.Java All = IC Fettable Cassica All: $ (all) IC: ICAO CasCi: $ (class: .java = .class) Fotable: Fableable .o ic.o: ic.c ic.h ftable .o: ftable.c ftable.h .PHONY: Clearly Clean: RM-RF Core * *. category *. O * .gch $ (ALL)  

Yes, you compile them at one time You can. If your "all" goal relies on all three applications, then "make all" should all be made. You can actually throw in "3J" to use three different threads and / or processes (it is not clear what you mean by "one time"). Besides, a couple of criticisms here:

  • Do not define "CC", "CFLAGS" or "LDFALGS" You should never define "CC" because it's default on your system C is automatically defined for the compiler, and you must attach only according to the requirement of "CFLAG" and "LDFALGS" (by using) to make your makeup informal by specifying them (Which can not be extended to override or additional).
  • Using Classes to Refer to ".java" files is confusing as hell ... You might want to call them Javascript_sarcs and JAVA_CLASSES = $ {JAVA_SRCS: .java = .class} Define.

For more clarification, please see me. He said, you may want to consider more modern building systems such as or. These methods are very easy to use, low error prone, and more portable (because they make things portable easier), and are designed to speed up.


Comments