Commit f3599bb4 authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

library file name renamed to libmruby.a on all platforms

parent 050cb3d7
...@@ -12,12 +12,7 @@ RLIB := $(TARGET).rbtmp ...@@ -12,12 +12,7 @@ RLIB := $(TARGET).rbtmp
DEPLIB := $(TARGET).d DEPLIB := $(TARGET).d
MRB1 := $(BASEDIR)/*.rb MRB1 := $(BASEDIR)/*.rb
MRBS := $(MRB1) MRBS := $(MRB1)
LIB := ../lib/mruby LIBR := ../lib/libmruby.a
ifeq ($(OS),Windows_NT)
LIBR := $(LIB).lib
else
LIBR := $(LIB).a
endif
# C compiler (gcc) # C compiler (gcc)
CC = gcc CC = gcc
......
...@@ -4,12 +4,7 @@ ...@@ -4,12 +4,7 @@
# project-specific macros # project-specific macros
# extension of the executable-file is modifiable(.exe .out ...) # extension of the executable-file is modifiable(.exe .out ...)
BASEDIR = . BASEDIR = .
TARGET := ../lib/mruby TARGET := ../lib/libmruby.a
ifeq ($(OS),Windows_NT)
LIB := $(TARGET).lib
else
LIB := $(TARGET).a
endif
YSRC := $(BASEDIR)/parse.y YSRC := $(BASEDIR)/parse.y
YC := $(BASEDIR)/y.tab.c YC := $(BASEDIR)/y.tab.c
EXCEPT1 := $(YC) $(BASEDIR)/minimain.c EXCEPT1 := $(YC) $(BASEDIR)/minimain.c
...@@ -40,11 +35,11 @@ ALL_CFLAGS = -Wall -Werror-implicit-function-declaration $(CFLAGS) ...@@ -40,11 +35,11 @@ ALL_CFLAGS = -Wall -Werror-implicit-function-declaration $(CFLAGS)
# generic build targets, rules # generic build targets, rules
.PHONY : all .PHONY : all
all : $(LIB) all : $(TARGET)
@echo "make: built targets of `pwd`" @echo "make: built targets of `pwd`"
# executable constructed using linker from object files # executable constructed using linker from object files
$(LIB) : $(OBJS) $(OBJY) $(TARGET) : $(OBJS) $(OBJY)
$(AR) r $@ $(OBJS) $(OBJY) $(AR) r $@ $(OBJS) $(OBJY)
-include $(OBJS:.o=.d) $(OBJY:.o=.d) -include $(OBJS:.o=.d) $(OBJY:.o=.d)
...@@ -65,6 +60,6 @@ $(YC) : $(YSRC) ...@@ -65,6 +60,6 @@ $(YC) : $(YSRC)
.PHONY : clean #cleandep .PHONY : clean #cleandep
clean : clean :
@echo "make: removing targets, objects and depend files of `pwd`" @echo "make: removing targets, objects and depend files of `pwd`"
-rm -f $(LIB) $(OBJS) $(OBJY) $(YC) -rm -f $(TARGET) $(OBJS) $(OBJY) $(YC)
-rm -f $(OBJS:.o=.d) $(OBJY:.o=.d) -rm -f $(OBJS:.o=.d) $(OBJY:.o=.d)
-rm -f $(patsubst %.c,%.o,$(EXCEPT1)) $(patsubst %.c,%.d,$(EXCEPT1)) -rm -f $(patsubst %.c,%.o,$(EXCEPT1)) $(patsubst %.c,%.d,$(EXCEPT1))
...@@ -5,13 +5,11 @@ ...@@ -5,13 +5,11 @@
# extension of the executable-file is modifiable(.exe .out ...) # extension of the executable-file is modifiable(.exe .out ...)
BASEDIR := ../../src BASEDIR := ../../src
TARGET := ../../bin/mrbc TARGET := ../../bin/mrbc
LIB := ../../lib/mruby LIBR := ../../lib/libmruby.a
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
EXE := $(TARGET).exe EXE := $(TARGET).exe
LIBR := $(LIB).lib
else else
EXE := $(TARGET) EXE := $(TARGET)
LIBR := $(LIB).a
endif endif
EXCEPT1 := EXCEPT1 :=
OBJ0 := $(patsubst %.c,%.o,$(wildcard $(BASEDIR)/../tools/mrbc/*.c)) OBJ0 := $(patsubst %.c,%.o,$(wildcard $(BASEDIR)/../tools/mrbc/*.c))
......
...@@ -5,13 +5,11 @@ ...@@ -5,13 +5,11 @@
# extension of the executable-file is modifiable(.exe .out ...) # extension of the executable-file is modifiable(.exe .out ...)
BASEDIR = ../../src BASEDIR = ../../src
TARGET := ../../bin/mruby TARGET := ../../bin/mruby
LIB := ../../lib/mruby LIBR := ../../lib/libmruby.a
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
EXE := $(TARGET).exe EXE := $(TARGET).exe
LIBR := $(LIB).lib
else else
EXE := $(TARGET) EXE := $(TARGET)
LIBR := $(LIB).a
endif endif
OBJ0 := $(patsubst %.c,%.o,$(wildcard $(BASEDIR)/../tools/mruby/*.c)) OBJ0 := $(patsubst %.c,%.o,$(wildcard $(BASEDIR)/../tools/mruby/*.c))
#OBJ1 := $(patsubst %.c,%.o,$(filter-out $(EXCEPT1),$(wildcard $(BASEDIR)/*.c))) #OBJ1 := $(patsubst %.c,%.o,$(filter-out $(EXCEPT1),$(wildcard $(BASEDIR)/*.c)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment