I use command line umk to build.
first I run make, which will build "all".
Then I run make install. It relies on "all". "all" will complain ${program_name} already exists, which IS the former result.
"install" should depends on "all" but use its result if it has been run.
all: ${program_name}
And, I wonder why "install" needs gawk, which is not needed when I compile anything in theide.Because you're using it on line 73:
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }'
all: ${program_name} ${program_name}: ${code_files} @echo building...; \
It is a strange makefile.
Isn'
I added your suggestion as dependency and changed it as the following. It is better.
t there a universal Makefile for umk?all: ${program_name} ${program_name}: ${code_files} @echo building...; \
I think you meant https:// code.google.com/p/upp-mirror/source/browse/trunk/uppbox/lpbu ild2/mkfileYes, that's it. I'm not sure what you mean by dist target, but it definitely doesn't have it. Also it has no install target, it only handles building. You can have a look on how it can be used at the other makefile in the same directory, which includes the general one to build theide and umk: https://code.google.com/p/upp-mirror/source/browse/trunk/upp box/lpbuild2/Makefile
I did not mention it because I cannot understand it. Don't know how to migrate it, since its parameters include package, etc. Plus, it has no "dist" target?
PKG=MyPackage NESTS=mysrc uppsrc FLAGS=GUI GCC DEBUG DEBUG_FULL STACKTRACE build: MyPackage # this is only needed if you want support parallel builds with dpkg-buildpackage -j ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) JOBS:=$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) else JOBS:=1 endif OPTS:=CC="cc -g" CXX="c++ -g" CFLAGS="-g" CXXFLAGS="-g" LDFLAGS="-Wl,--gc-sections -Wl,-O,2" TIME= COLOR=0 USEMAINCFG=0 y $(PKG): $(MAKE) -f mkfile JOBS=$(JOBS) PKG=$@ "NESTS=$(NESTS)" $(OPTS) "FLAGS=$(FLAGS)" TARGET=`pwd`/$@ install: install -D $(PKG) $(DESTDIR)/usr/bin/ clean: rm -f $(PKG)