make: Add projects.mk and prefixed win32 objects with win32-

- Add new makefile projects.mk, which is the place to define the minimally
  required set of variables to get a project's makefile oriented about
  the build machinery itself, mostly its locations in the file system. This
  also includes querying other projects. It's been pushed into a seperate
  makefile includeable early in the Makefile hierarchy, so that other
  special build variables (i.e. TARGET) can be specialized from within the
  project later to define build characteristics.
- Prefixed object files with $(FLAVOUR_PREFIX), to allow for building two
  targets from the same directory

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2016-12-25 13:45:12 +00:00
commit cb1e735f9c
5 changed files with 42 additions and 34 deletions

View file

@ -229,10 +229,10 @@ strip.done: $(EXE_ALL)
ifeq ($(LIBTYPE),shared)
$(SO_PREFIX)%.so: %.o
$(LD) -shared $(BUILD_LDFLAGS) $^ -o $@
$(LD) -shared $(BUILD_LDFLAGS) $(FLAVOUR_PREFIX)$^ -o $@
else
$(SO_PREFIX)%.so: %.o
$(LD) $(BUILD_LDFLAGS) $^ -o $@
$(LD) $(BUILD_LDFLAGS) $(FLAVOUR_PREFIX)$^ -o $@
endif
$(VERSION_SCRIPT):
@ -263,17 +263,17 @@ $(MSVCPP_IMPLIB): $(LIB_SO)
$(MS_LD) /machine:i386 /def:$(LIB_DEF)
endif
%.o: %.cpp
$(CPP) $(BUILD_CPPFLAGS) -c $<
$(FLAVOUR_PREFIX)%.o: %.cpp
$(CPP) $(BUILD_CPPFLAGS) -c $< -o $@
%.o: %.cc
$(CPP) $(BUILD_CPPFLAGS) -c $<
$(FLAVOUR_PREFIX)%.o: %.cc
$(CPP) $(BUILD_CPPFLAGS) -c $< -o $@
%.o: %.c
$(CC) $(BUILD_CFLAGS) -c $<
$(FLAVOUR_PREFIX)%.o: %.c
$(CC) $(BUILD_CFLAGS) -c $< -o $@
%.o: %.S
$(CC) $(BUILD_CFLAGS) -c $<
$(FLAVOUR_PREFIX)%.o: %.S
$(CC) $(BUILD_CFLAGS) -c $< -o $@
timers_%.h: %.h $(GENERATE_FUNC_TIMERS)
sh $(GENERATE_FUNC_TIMERS) $< $@