Permalink
Browse files

Makefile: Support for multiple programs

Add support for compiling multiple programs that use "libjvm.a" so we
can experiment with alternative launcher programs.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
  • Loading branch information...
1 parent 170fd50 commit 5b982d20b7e98205804467b9b72139914fa093b2 @penberg committed Mar 24, 2013
Showing with 8 additions and 6 deletions.
  1. +8 −6 Makefile
  2. 0 {vm → }/jato.c
View
@@ -19,15 +19,13 @@ ARCH_CONFIG=arch/$(ARCH)/include/arch/config$(ARCH_POSTFIX).h
# Make the build silent by default
V =
-PROGRAM := jato
+PROGRAMS = jato
LIB_FILE := libjvm.a
include arch/$(ARCH)/Makefile$(ARCH_POSTFIX)
include sys/$(SYS)-$(ARCH)/Makefile
-OBJS += vm/jato.o
-
LIB_OBJS += $(ARCH_OBJS)
LIB_OBJS += $(SYS_OBJS)
@@ -259,7 +257,7 @@ endif
DEFAULT_LIBS = -L. -ljvm -lrt -lpthread -lm -ldl -lz -lbfd -lopcodes -liberty -Lboehmgc -lboehmgc $(ARCH_LIBS)
-all: $(PROGRAM)
+all: $(PROGRAMS)
.PHONY: all
.DEFAULT: all
@@ -310,9 +308,13 @@ arch/$(ARCH)/insn-selector$(ARCH_POSTFIX).c: monoburg FORCE
$(E) " MONOBURG" $@
$(Q) $(MONOBURG) -p -e $(MB_DEFINES) $(@:.c=.brg) > $@
-$(PROGRAM): $(LIB_FILE) $(OBJS)
+
+jato.o: $(VERSION_HEADER)
+
+$(foreach p,$(PROGRAMS),$(eval $(p): $(LIB_FILE)))
+$(PROGRAMS): % : %.o
$(E) " LINK " $@
- $(Q) $(LINK) $(JATO_CFLAGS) $(DEFAULT_CFLAGS) $(CFLAGS) $(OBJS) -o $(PROGRAM) $(LIBS) $(DEFAULT_LIBS)
+ $(Q) $(LINK) $(JATO_CFLAGS) -o $@ $^ $(DEFAULT_LIBS)
$(LIB_FILE): monoburg boehmgc $(VERSION_HEADER) $(ASM_OFFSETS_HEADER) $(CLASSPATH_CONFIG) $(LIB_OBJS)
$(E) " AR " $@
File renamed without changes.

0 comments on commit 5b982d2

Please sign in to comment.