Skip to content

Instantly share code, notes, and snippets.

@ncopa
Created May 22, 2015 14:30
Show Gist options
  • Save ncopa/89b6a92893e544ee302f to your computer and use it in GitHub Desktop.
Save ncopa/89b6a92893e544ee302f to your computer and use it in GitHub Desktop.
# Part 0
# load common stuff
TOPDIR = .
include $(TOPDIR)/Makefile.common
# Part 1
# recursive make
.PHONY: subdirs
all clean distclean install uninstall: subdirs
SUBDIRS = systray
.PHONY: $(SUBDIRS)
subdirs: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@ $(MAKECMDGOALS)
SRC = panel.c misc.c plugin.c gtkbar.c bg.c
OBJ = $(SRC:%.c=%.o)
DEP = $(SRC:%.c=%.dep)
SYSTRAYOBJ = systray/systray.o
SYSTRAYOBJ: systray
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),distclean)
ifneq ($(MAKECMDGOALS),tar)
-include $(DEP)
endif
endif
endif
TARGET = trayer
$(TARGET): $(OBJ) $(SYSTRAYOBJ)subdirs
$(CC) $(LDFLAGS) $(OBJ) $(SYSTRAYOBJ) $(LIBS) -lX11 -o $@
ifeq (,$(DEVEL))
strip $@
endif
all: $(TARGET)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment