propagator/Makefile

130 lines
2.8 KiB
Makefile
Raw Normal View History

2004-11-22 16:47:29 +03:00
PACKAGE = propagator
2004-01-20 21:32:43 +03:00
2004-11-22 16:47:29 +03:00
DESTDIR =
2004-12-06 22:55:19 +03:00
2008-03-16 02:25:40 +03:00
bindir = /usr/bin
libdir = /usr/lib
2004-12-07 19:08:11 +03:00
2008-03-16 02:25:40 +03:00
INSTALL = /bin/install
#---------------------------------------------------------------
L ?= GLIBC
#L = KLIBC
ifeq ($(L),KLIBC)
CC = klcc
endif
ifeq ($(F),)
ifeq ($(L),GLIBC)
F = NEWT
else
F = STDIO
endif
endif
CFLAGS += -Os -pipe -Wall
2005-08-05 17:33:39 +04:00
GLIBC_INCLUDES =
KLIBC_INCLUDES =
INCLUDES = $($(L)_INCLUDES)
GLIBC_LDFLAGS = -static
KLIBC_LDFLAGS =
LDFLAGS = $($(L)_LDFLAGS)
STRIPCMD = strip -R .note -R .comment
#---------------------------------------------------------------
DEFS = -D_GNU_SOURCE
#---------------------------------------------------------------
INITSRC = init.c
INITOBJS = $(addprefix $(L)-,$(subst .c,.o,$(INITSRC)))
#---------------------------------------------------------------
STAGE1_DEFS =
2004-12-06 22:55:19 +03:00
ifneq ($(WITH_SHELL),)
STAGE1_DEFS += -DSPAWN_SHELL
2004-12-06 22:55:19 +03:00
endif
ifneq ($(WITH_SPLASH),)
STAGE1_DEFS += -DSPAWN_SPLASH
endif
2005-02-28 22:26:48 +03:00
ifeq ($(WITH_ADSL),)
STAGE1_DEFS += -DDISABLE_ADSL
endif
ifneq ($(WITHOUT_USBNET),)
STAGE1_DEFS += -DDISABLE_USBNET
2005-02-28 22:26:48 +03:00
endif
2004-12-06 22:55:19 +03:00
COMPILE = $(CC) $(CFLAGS) $(DEFS)
2004-01-20 21:32:43 +03:00
2004-11-22 16:47:29 +03:00
#- frontends
2004-01-20 21:32:43 +03:00
NEWT_FRONTEND_SRC = newt-frontend.c
2008-03-16 02:25:40 +03:00
NEWT_FRONTEND_LIBS = $(libdir)/libnewt.a $(libdir)/libslang.a
2004-01-20 21:32:43 +03:00
STDIO_FRONTEND_SRC = stdio-frontend.c
STDIO_FRONTEND_LIBS =
2004-01-20 21:32:43 +03:00
FRONTEND_OBJS = $(addprefix $(L)-,$(subst .c,.o,$($(F)_FRONTEND_SRC)))
FRONTEND_LINK = $(FRONTEND_OBJS) $($(F)_FRONTEND_LIBS)
2004-01-20 21:32:43 +03:00
GLIBC_STAGE1_OWN_LIBS =
KLIBC_STAGE1_OWN_LIBS =
2004-01-20 21:32:43 +03:00
STAGE1_OWN_LIBS = $($(L)_STAGE1_OWN_LIBS)
KLIBC_STAGE1_NETWORK_LIBS =
2008-03-16 02:25:40 +03:00
GLIBC_STAGE1_NETWORK_LIBS = $(libdir)/libresolv.a
STAGE1_NETWORK_LIBS = $($(L)_STAGE1_NETWORK_LIBS)
2004-01-20 21:32:43 +03:00
STAGE1SRC = stage1.c log.c tools.c modules.c probing.c \
mount.c lomount.c automatic.c frontend-common.c \
cdrom.c disk.c \
2008-03-13 19:12:12 +03:00
network.c dhcp.c url.c dns.c adsl.c
STAGE1OBJS = $(addprefix $(L)-,$(subst .c,.o,$(STAGE1SRC)))
2004-01-20 21:32:43 +03:00
#---------------------------------------------------------------
ALLSRC = $(INITSRC) $(STAGE1SRC)
TARGETS = init gencpio
2004-01-20 21:32:43 +03:00
all: version.h $(TARGETS)
2004-01-20 21:32:43 +03:00
init: $(INITOBJS) $(STAGE1OBJS) $(STAGE1_OWN_LIBS) $(STAGE1_NETWORK_LIBS) $(FRONTEND_LINK) $(STAGE1_LIBC)
$(CC) -o $@ $^ $(LDFLAGS)
2004-01-20 21:32:43 +03:00
$(STRIPCMD) $@
$(INITOBJS): $(L)-%.o: %.c
$(COMPILE) $(INIT_DEFS) -c $< -o $@
2004-01-20 21:32:43 +03:00
$(STAGE1OBJS): $(L)-%.o: %.c
$(COMPILE) $(INCLUDES) $(STAGE1_DEFS) -c $< -o $@
$(FRONTEND_OBJS): $(L)-%.o: %.c
$(COMPILE) $(INCLUDES) -c $< -o $@
2004-01-20 21:32:43 +03:00
version.h:
2009-07-29 18:52:02 +04:00
echo -e \#define VERSION \"$(version)\" \\n\#define DISTRIB_NAME \"ALT Linux\" > $@
2004-01-20 21:32:43 +03:00
gencpio: gen_init_cpio.c
$(CC) $(CFLAGS) $(DEFS) -o $@ $^
initfs: mkinitfs $(TARGETS)
sh $< $@
install: initfs
2008-03-16 02:25:40 +03:00
$(INSTALL) -D -m0755 gencpio $(DESTDIR)$(bindir)/gencpio
$(INSTALL) -m0755 mkmodpack $(DESTDIR)$(bindir)/mkmodpack
$(INSTALL) -D -m0644 initfs $(DESTDIR)$(libdir)/$(PACKAGE)/initfs
2004-01-20 21:32:43 +03:00
clean:
rm -f *.o .depend $(TARGETS) version.h
2004-01-20 21:32:43 +03:00
.depend: version.h
2004-01-20 21:32:43 +03:00
$(CPP) $(CFLAGS) -M $(ALLSRC) > .depend
ifeq (.depend,$(wildcard .depend))
include .depend
endif