aboutsummaryrefslogtreecommitdiffstats
path: root/com32/cmenu/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'com32/cmenu/Makefile')
-rw-r--r--com32/cmenu/Makefile29
1 files changed, 16 insertions, 13 deletions
diff --git a/com32/cmenu/Makefile b/com32/cmenu/Makefile
index d51b2e84..f4321366 100644
--- a/com32/cmenu/Makefile
+++ b/com32/cmenu/Makefile
@@ -18,31 +18,34 @@
NOGPL := 1
LIBS = libmenu/libmenu.c32 \
- $(com32)/libutil/libutil.c32 \
- $(com32)/lib/libcom32.c32
+ $(objdir)/com32/libutil/libutil.c32 \
+ $(objdir)/com32/lib/libcom32.c32
-topdir = ../..
-MAKEDIR = $(topdir)/mk
+VPATH = $(SRC)
include $(MAKEDIR)/elf.mk
-CFLAGS += -I./libmenu
+CFLAGS += -I$(SRC)/libmenu
-LIBMENU = libmenu/syslnx.o libmenu/com32io.o libmenu/tui.o \
- libmenu/menu.o libmenu/passwords.o libmenu/des.o libmenu/help.o \
- $(com32)/libutil/libutil.c32 $(com32)/lib/libcom32.c32
+LIBMENU = $(objdir)/com32/libutil/libutil.c32 \
+ $(objdir)/com32/lib/libcom32.c32 \
+ libmenu/syslnx.o libmenu/com32io.o libmenu/tui.o \
+ libmenu/menu.o libmenu/passwords.o libmenu/des.o libmenu/help.o
-CMENUS = $(patsubst %.c,%.c32,$(wildcard *.c))
-IMENUS = $(patsubst %.menu,%.c32,$(wildcard *.menu))
+CMENUS = $(patsubst %.c,%.c32,$(wildcard $(SRC)/*.c))
+IMENUS = $(patsubst %.menu,%.c32,$(wildcard $(SRC)/*.menu))
-MENUS = $(LIBS) $(CMENUS) $(IMENUS)
+MENUS = $(LIBS) $(subst $(SRC)/,,$(CMENUS) $(IMENUS))
.SUFFIXES: .S .c .o .elf .c32 .menu
.PRECIOUS: %.c
%.c: %.menu adv_menu.tpl
- $(PYTHON) menugen.py --input=$< --output=$@ --template=adv_menu.tpl
+ $(PYTHON) $(SRC)/menugen.py --input=$< --output=$@ --template=$(SRC)/adv_menu.tpl
-all: menus
+all: makeoutputdirs menus
+
+makeoutputdirs:
+ @mkdir -p $(OBJ)/libmenu
libmenu/libmenu.elf: $(LIBMENU)
$(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) \