From bb28b387416a8a691cf05d7a5464654d4b2b92a2 Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Thu, 3 Feb 2022 17:29:43 +0000 Subject: [PATCH] Makefile editswq --- Makefile | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index f976fe0..5222b58 100755 --- a/Makefile +++ b/Makefile @@ -1,6 +1,3 @@ -procs != nproc -MAKEFLAGS = --jobs=$(procs) - UNAME != uname ifeq ($(OS),Windows_NT) @@ -24,11 +21,11 @@ DIRS = engine pinball editor brainstorm ETP = ./source/engine/thirdparty/ define make_objs - find $(1) -type f -name *.c -o -name *.cpp | sed 's|\.c.*|.o|' | sed 's|\.|./obj|1' + find $(1) -type f -name '*.c' -o -name '*.cpp' | sed 's|\.c.*|.o|' | sed 's|\.|./obj|1' endef define find_include - find $(1) -type f -name *.h | sed 's|\/[^\/]*\.h$$||' | sort | uniq + find $(1) -type f -name '*.h' | sed 's|\/[^\/]*\.h$$||' | sort | uniq endef define prefix @@ -86,18 +83,19 @@ CLIBS != $(call prefix, $(CLIBS), -l) LELIBS = -Wl,-Bstatic $(ELIBS) -Wl,-Bdynamic $(CLIBS) -DEPENDS = $(bsobjects:.o=.d) $(eobjects:.o=.d) +objects = $(bsobjects) $(eobjects) $(pinobjects) +DEPENDS = $(objects:.o=.d) +-include $(DEPENDS) yuginec = ./source/engine/yugine.c -.SECONARY: $(eobjects) - engine: libengine.a - @echo Linking engine + Linking engine $(CXX) $(yuginec) -DGLEW_STATIC $(includeflag) $(LIBPATH) $(LINKER_FLAGS) $(LELIBS) -o yugine libengine.a: $(eobjects) @echo Making library engine.a + @ar -r libengine.a $(eobjects) xbrainstorm: libengine.a $(bsobjects) @@ -110,8 +108,6 @@ pinball: libengine.a $(pinobjects) @$(CXX) $(pinobjects) -DGLEW_STATIC $(includeflag) $(LIBPATH) $(LINKER_FLAGS) $(LELIBS) -o $@ mv pinball paladin/pinball --include $(DEPENDS) - $(objprefix)/%.o:%.cpp @mkdir -p $(@D) @echo Making C++ object $@ @@ -124,5 +120,4 @@ $(objprefix)/%.o:%.c clean: @echo Cleaning project - @rm -f $(eobjects) $(bsobjects) - + @rm -f $(eobjects) $(bsobjects) \ No newline at end of file